Is it possible to make a merge in one command without committing and modifying the index?

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

  • When converting to git, how should I handle a single directory svn checkout?
  • Files missing in Git repository
  • Git: send commit to another branch so I can work and merge back, without (very slow) checkout?
  • I need help setting up a github webhook with a localhost jenkins
  • Continuous deployment in EC2 using Codeship
  • What happens after a Git clone is “done.”?
  • 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.

  • vim syntax highlighting for git commit messages - custom commentchar
  • How does git find subtree, when we use subree merging strategy?
  • How to undo a merge that has been committed already and other merges have been done after that also
  • BitBucket - Create repository and sub modules
  • Git Flow : Do you have to manually delete the feature branches from remote after finishing the feature?
  • Deploy to Azure from Git Local System.IO.IOException: There is not enough space on the disk
  • One Solution collect form web for “Is it possible to make a merge in one command without committing and modifying the index?”

    There is no way in git to perform these two actions in one command, but you could combine them using bash by running it as:

    git merge --no-commit tool && git reset

    You could even alias that to something short, like alias gtool="git merge ..." and then just run gtool.

    Git Baby is a git and github fan, let's start git clone.