Let’s say that I’ve got some cool tool for development and I keep it on a branch called ‘tool’. My product has many customizations and hence there are many branches used for development. Despite the fact that the tool is so groovy, I don’t want to commit them to any other branch.
When I need the tool on some development branch, I use git in the following way:
git merge --no-commit tool
git reset
With the above I get all the files I need to my current branch and I clean my index.
The question is whether this is achievable in one command? Maybe there’s some other good way to use git for my scenario? I’ve got to say that I don’t like git stash though.
There is no way in
gitto perform these two actions in one command, but you could combine them usingbashby running it as:You could even alias that to something short, like
alias gtool="git merge ..."and then just rungtool.