git operation method

1. git common commands

1. Initialize the local library

git init

insert image description here

2. Check status

git status

insert image description here

3. Add a staging area

git add  文件名

insert image description here

4. Delete the temporary storage area

git rm --cached 文件名

insert image description here

5. Submit the local library

git commit -m "提交说明"  文件名

insert image description here

6. View logs

git relog 查看精简日志
git log    查看详细日志

insert image description here
insert image description here

7. Version traversal

git reset --hard 版本号

insert image description here

2. Branch operation

1. View branch

git branch -v

insert image description here

2. Add branch

git branch 分支名

insert image description here

3. Switch branches

git checkout  分支名

insert image description here

4. Merge branches

git merge 分支名

insert image description here
When the code conflicts, open the file
insert image description here
insert image description here
insert image description here

Three. github operation

1. Create a link alias

git remote add  别名  链接

insert image description here

2. push to push the local library

git push 别名  分支

insert image description here

3. Pull the code

git pull  别名  分支

Guess you like

Origin blog.csdn.net/danran550/article/details/124745895