Git pull remote branch to local
First, you need to check whether you have a connection with the remote warehouse.
git remote -v
If not, add it yourself
Git remote add origin xxxx (GIT warehouse address of your remote branch)
If you want to commit code every day, you can bypass the above step and switch branches directly
git checkout -b Q3 origin/Q3
At this time, the operation failure prompt is as follows:
- fatal: ‘origin/Q3’ is not a commit and a branch ‘Q3’ cannot be created from it
It means that you don’t have the remote branch Q3 locally.
You can perform git branch – r to check if there is a Q3 remote branch locally.
Pull remote branch to local and switch branches.
git fetch origin Q3 git checkout -b Q3 origin/Q3
Pull remote branch to local
git pull origin Q3
My blog and GitHub, if you like, go to dianxing, thank you.