How to download and merge remote changes for the current branch?

git pull

To download and merge remote changes for your current branch use git pull without parameters.

Git pull is shorthand for git fetch followed by git merge.

Layer 1
Terminal Example
git status
On branch main
Your branch is behind 'origin/main' by 2 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

nothing to commit, working tree clean

git pull
Updating 5d6b450..9a2b1f6
Fast-forward
 code.rb | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 code.rb

See git pull to learn more about it.

Last modified on November 30, 2021.

You might also like