Home > Common Problem > git pull pull code command

git pull pull code command

zbt
Release: 2023-06-20 17:09:06
Original
10127 people have browsed it

git pull pull code command: pull the remote warehouse code to the local. Of course, the premise of this command is that your local code is linked to the remote code, whether it is upstream or git clone. And by default, the branch associated with the branch in the remote code is pulled and merged with the local branch. At the same time, git pull not only pulls the code, but also merges the pulled code with the local code.

git pull pull code command

git pull pull code command.

git pull

Function

Pull the latest code from the remote warehouse to the local

Code analysis

git pull
Copy after login

Pull the remote warehouse code to the local. Of course, the premise of this command is that your local code has a link with the remote code, whether it is your upstream or git Clone or not. And by default, the branch associated with the branch in the remote code is pulled and merged with the local branch. At the same time, git Pull not only pulls the code, but also merges the pulled code with the local code.

git pull origin master:master
Copy after login

This line of code is a relatively complete way of writing the previous line of code. Specifies which branch of which remote repository to pull. And merge it into the local branch. Because we may have one local warehouse corresponding to more than one remote warehouse. For example, in the case of fork, we often need to go to the source author's warehouse.

git pull --no-commit
Copy after login

As mentioned above, git pull is actually divided into two steps. One is to pull the code to the local, and git The fetch command has the same effect. The second is to merge the pulled code with the code of the current branch of the local warehouse. This command means that if you pull it down, don’t proceed to the second step.

git pull --verbose
Copy after login

This is to let you see the content of the code you pulled and the specific process of merging it. Generally not used.

The above is the detailed content of git pull pull code command. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template