Whats the difference between push , commit & fetch ,merge. Git commit basically “records changes to the local repository” while git push “updates remote refs along with associated objects”.
Git push will copy all commits from current branch that are missing in destination branch (a38de, 893cf, 756ae) and move the pointers both in destination branch and remote tracking branch to the same commit in local branch. Note that it will not perform any merge.
Always Pull Before a Push Doing so will ensure that your local copy is in sync with the remote repository. Remember, other people have been pushing to the remote copy, and if you push before syncing up, you could end up with multiple heads or merge conflicts when you push.
One way:
git checkout myBranch git push origin myBranch:master
Another way:
git checkout master git merge myBranch git push
What is difference between these two?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With