difference between git pull and git fetch

git fetch just update and pull all branches from your remote repository . This operation is safe to run because it does not overwrite any or discard any unmerge changes in your current branch

git pull just update  and pull all new changes in your current checked branch and  up to date with its remote version

Note: You can also pull code from another branch code in your current checked branch like you made a new branch from parent, other people are also used to work in parent branch then you should take pull before pushes your changes to parent branch to prevent conflicts.



git pull on a different branch:

You will be able to pull changes from parent into your current branch while working in another branch by using this command

git merge master

Tags:

git

Share:

Related posts