Home  >  Article  >  Development Tools  >  Briefly introduce the use of git, pull code, and submit

Briefly introduce the use of git, pull code, and submit

coldplay.xixi
coldplay.xixiforward
2021-04-29 18:06:017018browse

Briefly introduce the use of git, pull code, and submit

##Basic use of git

Briefly introduce the use of git, pull code, and submit

Recommended (free):

Git

git Pull remote code

Step one: Pull remote code

git clone pulled code address

Briefly introduce the use of git, pull code, and submit

Step 2: View local branches and remote branches

1. Right-click on the pulled project to open Git Bash Here (operate git command)


Briefly introduce the use of git, pull code, and submit##2.git branch -a View all local and remote branches


Briefly introduce the use of git, pull code, and submitAll branches are successfully seen here: main is the local branch, and the asterisk * in front indicates the branch being used

Branches with remotes in front are remote branches .


The third step is to associate the remote branch with the local branch

1. git pull origin seven
(If you want to pull Go to the local dev branch, first git checkout -b dev, and then use git pull origin dev, thus binding the local dev branch to the remote origin/dev)



This command is to Associate the local branch with the remote branch, and pull the remote branch origin to the local branch mainBriefly introduce the use of git, pull code, and submit
2. git branch -vv

indicates that the main branch has been bound to origin/seven.



Briefly introduce the use of git, pull code, and submit3. For the code that has been associated, directly enter git pull to synchronize it

The fourth step is to upload the local code to the remote On the branch

1. View: gitk --all &
2. View the modified content: git status

3. Add to the modified local files: git add .
4. Submit to the local: git commit -m "Add comment"
5. Pull the latest code from the server: git pull
6. Submit to the server: git push origin Name of the local branch: Server branch name

git basic use

Briefly introduce the use of git, pull code, and submitgit pull remote Code

Step one: pull the remote code

git clone pulled code address

Briefly introduce the use of git, pull code, and submit

Step 2: View local branches and remote branches

1. Right-click on the pulled project to open Git Bash Here (operate git Command)


Briefly introduce the use of git, pull code, and submit2.git branch -a View all local and remote branches


Briefly introduce the use of git, pull code, and submitAll branches are successfully seen here: main It is a local branch. The asterisk * in front indicates the branch being used

. Branches preceded by remotes are remote branches.


The third step is to associate the remote branch with the local branch

1. git pull origin seven
(If you want to pull to the local dev branch, first git checkout -b dev, and then use git pull origin dev, thus connecting the local dev branch to the remote origin /dev is bound)
Briefly introduce the use of git, pull code, and submit
This command is to associate the local branch with the remote branch, and pull the remote branch origin to the local branch main

2. git branch - vv
indicates that the main branch has been bound to origin/seven.
Briefly introduce the use of git, pull code, and submit

3. For the code that has been associated, directly enter git pull to synchronize it

The fourth step is to upload the local code to the remote On the branch

1. View: gitk --all &
2. View the modified content: git status
3. Add to the modified local files: git add .
4. Submit to the local: git commit -m "Add comment"
5. Pull the latest code from the server: git pull
6. Submit to the server: git push origin Name of the local branch: Server branch name

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

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete