Create a branch

Git branch branch name or git checkout -b branch name (create and switch) or git switch -c branch name, such as git branch developCopy the code

The develop branch is created locally, as shown in the following figure:

Note that this command does not push all branches to remote branches, as shown above. The remote branch does not have the branch we just created. If you want to push local branches to remote branches, look below

Push local branch to remote

Git push origin Local branch: remote branch, for example, git push origin develop:developCopy the code

After executing the above command, you will push the locally created Develop branch to the remote, and create the Develop branch remotely, as shown in the following figure:

Switch branch

Git checkout branch name or Git switch branch name, for example: Git checkout DevelopCopy the code

Execute the following command to switch the current master branch to the Develop branch, as shown in the figure below:

The asterisk to the left of yellow indicates the current branch

Pull the code

git pull 
Copy the code

After the above command is executed, the following error will be reported, as shown in the following figure:

If the local Develop branch is not connected to the remote branch, run the following command

 git branch --set-upstream-to=origin/develop develop
Copy the code

To be updated