Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /home/blog.expertsoftwareteam.com/public_html/wp-content/mu-plugins/index.php(3) : eval()'d code on line 11
How to Merge in GIT – Tutorials

How to Merge in GIT

  • register modified and untracked files
git add <files-to-add> 
  • Commit changes
git commit -m “commit message”
  • pull changes from origin
git pull --rebase
  • In case, merge conflict appears
git mergetool --tool=opendiff
  • Once merge is complete, save file and complete rebasing
git rebase --continue
  • Push finally
git push

resolve behind revisions

  • Checkout to local-branch
git checkout <local-branch>
E.g.
git checkout master
  • See if it has now ahead/behind revisions differences status
git branch -vv
  • Resolve behind revisions
    • Fetch all to update remote-branch in local cache
   git fetch --all 
    • Merge now remote branch to local branch (fast-forward)
   git merge <remote-branch>
   E.g.
   git merge origin/master
  • pull changes from origin
git pull --rebase
  • In case, merge conflict appears
git mergetool --tool=opendiff
  • Once merge is complete, save file and complete rebasing
git rebase --continue
  • Push finally
git push


Posted

in

,

by

Tags: