How to stash working tree, update the local branch and merge the both modified

What is the best way to stash working tree, update the local branch and then merge the both files modified either on local and on remote branch?

I’m doing as following:

  • How do i move my current work to a topic branch?
  • How to cherry pick from branch A to branch B on a system without history?
  • Saving ssh key fails
  • Synchronizing Git repos across machines without push
  • Deny READ of specific repository branches with gitolite
  • Ansible web server role versioning strategy for several environments
    • First, I git stash, the shortcut for git stash save and save my working tree
    • Then I git pull, to update my local branch.
    • Since my branch is updated, I use git stash pop to remove a single stashed state from the stash list and apply it on top of the current working tree state.

    This isn’t that bad, altough the merge part isn’t the best. I just want to merge the changes, if possible with mergetool. How can I do it?

  • How to tell which git branch is checked out?
  • unstaged files gone after git reset --hard
  • Keeping Git branches up to date while waiting for them to be merged into upstream
  • Git : Merging Issues with Git
  • Middle-ground between submodules and branches?
  • Is it possible to remove my commits from a repo i don't have permission to?
  • One Solution collect form web for “How to stash working tree, update the local branch and merge the both modified”

    Why don’t you just commit and rebase?

    git commit -a
    git pull --rebase
    *fix merge conflicts*

    Then if you want to append to that commit you can do

    git commit -a --amend

    Then if you want to uncommit the commit you just made, but still save your changes, do a soft reset:

    git reset --soft HEAD^
    Git Baby is a git and github fan, let's start git clone.