Git: merge

The following push command is to push “master” branch to remote “origin” repository.

git push origin master


But this merge command is to merge  master branch of “local” repository.

git merge origin/master


It’s troublesom. 🙁

To avoid mistakes, I remember “merge command does’t see remote repositoy”.

Before git merge, we have to fetch diff data from remote repository.

git fetch

git merge origin/master


git pull origin master command is equals to above two commands.

Leave a Reply

Your email address will not be published. Required fields are marked *