Git distributed development is divided into remote warehouse, local warehouse and local files.
Read relevant information and discover:
git add 将本地修改的文件提交的缓冲区
git commit 将缓存区中的文件提交当本地仓库
git push 将本地仓库推送到远端仓库
Combined with daily project development (GitLab), I have a few questions:
完成开发后,
1.git stash
2.git pull remote
3.git stash pop
4.如有冲突解决冲突
5.git add --all
6.git commit -a -m "xxx"
7.git push origin
8.GitLab 本地仓与远端仓发合并请求
9.管理员同意合并 代码同步
Based on the project, I understand that git commit means adding comments, and git push means pushing the local code to the local warehouse and then initiating a merge request with the remote end. Is there anything wrong?
There are some problems with my description
实际开发中是有一个远端公用库,比如叫做ljt,有3位开发人员,依次派生了3个库出来,我派生的库名字叫做mark。每次push到a库,然后到GitLab发起合并请求。
远端公用库ljt有3个分支,依次为master,dev,release,我派生下来的库mark,也有三个同样的分支,我在GitLab上删除掉dev,release分支后,每次修改完代码后push到mark/master分支然后发合并请求,但是我使用命令行查看远端分支会显示如图。
This is the library I forked:
This is the remote library:
(ignore hotfix branch)
An article that uses drawings to explain the principles of git to you, very clear: Illustrated git
A tutorial on how to use git from beginning to end, also very clear: git concise tutorial
Hope it can help you
This explanation is very clear
http://www.liaoxuefeng.com/wi...
Well, that’s right, it’s okay if you understand it that way!
git commit
是提交到本地仓库,通过-m
参数来添加注释提交。git push
Push to remote.Let’s understand it that way, as long as you know how to use it.