First, when you create a branch, do so with git switch: git switch -c test origin/master, preferably after a git fetch (in order for origin/master to reflect the latest commit pushed there)

Then make sure your first push is git push -u origin test in order to establish a remote tracking branch origin/test, which will facilitate the subsequent pushes to that branch.

When you colleague do a git switch test (after a fetch), the default guess mode automatically establish a remote tracking branch (as if they typed git switch -c <branch> --track <remote>/<branch>)
That is why a simple git pull would be enough to update their local test branch after your step 5.

Answer from VonC on Stack Overflow
🌐
CloudBees
cloudbees.com › blog › git-pull-how-it-works-with-detailed-examples
Git Pull: How It Works With Detailed Examples
July 9, 2021 - Learn how to use git pull, with detailed examples on what it does and step-by-step guidance on syncing with remote repositories.
🌐
Atlassian
atlassian.com › git › tutorials › syncing › git pull
How to Pull a Git Repository? | Atlassian Git Tutorial
Executing the default invocation of git pull will is equivalent to git fetch origin HEAD and git merge HEAD where HEAD is ref pointing to the current branch. ... This example first performs a checkout and switches to the <new_feature> branch.
Discussions

github - Git pull command - Stack Overflow
Please help to clarify the question below. I have done the following steps. git checkout -b test origin/master Made some code changes git add followed by git commit and git push One of my colleagues More on stackoverflow.com
🌐 stackoverflow.com
is git pull not recommended?
If you're working with branches that get updated by multiple contributors regularly, using pull on that branch can leave you in conflicted states that can be annoying. Using the --rebase switch like another comment mentioned can help keep the history linear but it doesn't necessarily solve the conflict issues. Not using pull doesn't make the problem go away, it just keeps you from ending up in a conflicted state you have to resolve before continuing, letting you instead choose how and when you want to deal with potential conflicts (typically alternative flow is doing fetch, then doing a merge or rebase when you're ready). If you don't find yourself consistently working on branches that others are contributing to, then pull likely won't cause you any issues. More on reddit.com
🌐 r/git
18
4
May 14, 2022
Is `don't use git pull` an outdated opinion?
I advice my juniors to fetch instead of pulling because pull does a whole bunch of things all at once and I want them to learn how git works so they can be more independent. Personally I like to use fetch because I like to read commits before I fast forward (and solve any conflicts) Pull is fine. It does a bunch of things that are all fine. But I feel like it can be the hammer in the toolklt that you need to be aware isn't the only tool More on reddit.com
🌐 r/git
101
52
April 3, 2025
Explaining git fetch vs git pull to juniors using real examples
git pull == git fetch+ git merge (or + git rebase, if git pull --rebase) Also, beat it into their heads: if you don't understand what pull does, don't do pull More on reddit.com
🌐 r/git
61
129
December 21, 2025
People also ask

What is the difference between git pull and git fetch?
git fetch downloads changes without modifying your working directory, while git pull fetches and merges changes automatically.
🌐
golinuxcloud.com
golinuxcloud.com › home › devops › git › git pull explained: commands, examples, rebase & safe usage guide
Git Pull Explained: Commands, Examples, Rebase & Safe Usage Guide ...
Is git pull safe to use?
Yes, git pull is safe, but you should review changes or use git fetch if you want more control before merging.
🌐
golinuxcloud.com
golinuxcloud.com › home › devops › git › git pull explained: commands, examples, rebase & safe usage guide
Git Pull Explained: Commands, Examples, Rebase & Safe Usage Guide ...
🌐
W3Schools
w3schools.com › git › git_pull_from_remote.asp
Git Pull from Remote
It lets you see what others have pushed before you merge or pull. git fetch origin remote: Enumerating objects: 5, done. remote: Counting objects: 100% (5/5), done. remote: Compressing objects: 100% (3/3), done. remote: Total 3 (delta 2), reused ...
🌐
Git
git-scm.com › docs › git-pull
Git - git-pull Documentation
Defaults to the configured upstream for the current branch, or origin. See UPSTREAM BRANCHES below for more on how to configure upstreams. ... Which branch or other reference(s) to fetch and integrate into the current branch, for example main in git pull origin main.
Find elsewhere
🌐
GitHub
github.com › git-guides › git-pull
Git Guides - git pull · GitHub
If this happens, use git status to identify what changes are causing the problem. Either delete or commit those changes, then git pull or git merge again. Keeping the main branch up to date is generally a good idea. For example, let's say you have cloned a repository.
🌐
GeeksforGeeks
geeksforgeeks.org › git › what-is-git-pull
Git Pull - GeeksforGeeks
May 9, 2026 - Stage 2: It performs a merge, creating a new merge commit and updating HEAD. Example: If a teammate adds New.txt to the remote, git pull fetches and merges it into your local repository.
🌐
Medium
medium.com › @pinglinh › how-to-use-git-pull-80ad77a8afc6
How to use git pull. How to use git pull function? Let me… | by linhothy | Medium
July 27, 2016 - How to use git pull How to use git pull function? Let me tell you how I would usually push my first initial commit onto GitHub IF I already had some files on my local directory i.e. laptop. 1. I’d …
🌐
Linux Kernel
kernel.org › pub › software › scm › git › docs › git-pull.html
git-pull(1) Manual Page
December 14, 2025 - Defaults to the configured upstream for the current branch, or origin. See UPSTREAM BRANCHES below for more on how to configure upstreams. ... Which branch or other reference(s) to fetch and integrate into the current branch, for example main in git pull origin main.
🌐
freeCodeCamp
freecodecamp.org › news › git-pull-explained
Git Pull Explained
January 27, 2020 - # General format git pull OPTIONS REPOSITORY REFSPEC # Pull from specific branch git pull REMOTE-NAME BRANCH-NAME ... OPTIONS are the command options, such as --quiet or --verbose. You can read more about the different options in the Git documentation · REPOSITORY is the URL to your repo. Example: https://github.com/freeCodeCamp/freeCodeCamp.git
🌐
Git Tower
git-tower.com › learn › git faq › how to use git pull in git (with examples)
How to Use git pull in Git (with Examples) | Learn Version Control with Git
1 week ago - The git pull command downloads the code that is available from a remote repository (such as GitHub, GitLab, BitBucket, or another code hosting platform) and automatically merges any changes.
🌐
GitKraken
gitkraken.com › home › learn › tutorials › what is git pull?
What is Git Pull? | Beginner Git Tutorial
April 23, 2025 - Watch this beginner Git tutorial video to learn what the Git pull command is—spoiler alert: it’s actually a Git fetch followed by a Git merge. You will see an example of how to perform a Git pull, including how to pull changes from a remote branch to update your local copy of the repo.
🌐
Simplilearn
simplilearn.com › home › resources › devops › git tutorial for beginners › git pull request basics explained with demo
Git Pull Request Basics Explained with Demo
February 15, 2026 - Being a combination of Git fetch & Git merge, learn how the Git pull command can be used to pull commands from the local repository along with the demo.
Address   5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
Git
git-scm.com › docs › git-request-pull
Git - git-request-pull Documentation
which will produce a request to the upstream, summarizing the changes between the v1.0 release and your master, to pull it from your public repository. If you pushed your change to a branch whose name is different from the one you have locally, e.g. git push https://git.ko.xz/project master:for-linus
🌐
W3Schools
w3schools.com › git › git_branch_pull_from_remote.asp
Git Pull Branch from Remote
git pull remote: Enumerating objects: 5, done. remote: Counting objects: 100% (5/5), done. remote: Compressing objects: 100% (3/3), done. remote: Total 3 (delta 2), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), 851 bytes | ...
🌐
DataCamp
datacamp.com › tutorial › git-pull
Git Pull: Keeping Your Local Repository Up to Date | DataCamp
March 10, 2025 - While git pull is convenient, some developers prefer splitting the process into two steps for more control: ... This retrieves remote changes without merging them. ... Let’s walk through some practical examples of using git pull so you can see precisely how these commands work in real scenarios.
🌐
IONOS
ionos.com › digital guide › websites › web development › git pull
How to use Git Pull - IONOS
July 31, 2023 - In our example, we’ll use the command Git Checkout to switch to our local repos­i­to­ry. Then, in the second step, we run Git Pull. The command causes the contents of our remote repos­i­to­ry to be down­loaded and Git to perform Git Merge im­me­di­ate­ly af­ter­wards.
🌐
W3Schools
w3schools.com › git › git_pull.asp
Git Pull
git log origin/main commit a7cdd4bf8f851b8de08d8b26be4ec82b371f4b48 (origin/main) Author: w3schools-test <77673807+w3schools-test@users.noreply.github.com> Date: Thu Mar 25 11:41:24 2021 +0100 Created Readme.md commit 9ab23f8e199880def2dfa775ae4868839d999747 (HEAD -> main) Merge: 4068962 aad81e1 Author: w3schools-test <77673807+w3schools-test@users.noreply.github.com> Date: Tue Mar 23 15:15:21 2021 +0100 Merge pull request #2 from w3schools-test/new-style New style looks good ... ... That looks as expected, but we can also verify by showing the differences between our local main and origin/main: git diff main...origin/main diff --git a/README.md b/README.md new file mode 100644 index 0000000..f43f0fc --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# hello-world +Hello World repository for Git tutorial +This is an example repository for the Git tutoial on https://www.w3schools.com
🌐
The Knowledge Academy
theknowledgeacademy.com › blog › git-pull
Git Pull Explained: Usage, Working, and Examples
October 29, 2024 - Git Pull is a Git command that updates your local repository by fetching and merging the latest changes from a remote repository like GitHub or GitLab.