git其实是是一个不用网络的仓库(本地仓库),你也可以把数据push到githubUp (remote warehouse).
Your current pull和push is all data interaction between the local version library and the remote warehouse.
In your local warehouse, it actually consists of two parts:
Workspace (Working Directory) //Visible
Repository (Repository) //Invisible
Temporary storage area(Stage)
branch (branch)
The repository contains staging area and branches
Process:
First submission:
- Use git add to move files to workspace ---》Staging area (local)
- Move the file to the temporary storage area through git commit ---》Branch (local)
- by git push 将文件 分支 ---》远程库 (github)
Submit changes:
- Move the file to the temporary storage area through git commit ---》Branch (local)
- by git push 将文件 分支 ---》远程库 (github)
pull&push
- Move the file to the remote library through git pull ---》Branch (local)
- by git push 将文件 分支 ---》远程库 (github)
The above two operations require changes and differences before they can be executed.
Therefore, it will prompt that the contents of the staging area and the remote library are consistent.
status refers to the local status, showing the difference between the local workspace and the local warehouse
The files you created and the files you modified but did not submit (commit) are all displayed here. After submission, they will be empty
pull/push is a synchronization operation between the local warehouse and the remote warehouse, and up-to-date indicates that the local warehouse and the remote warehouse are synchronized
I just solved this problem. I found that there is an extra master in my branch, that is, there is a master and origin/master in the branch. I don’t know what the difference is. After switching the points, the submission is successful directly.
git
其实是是一个不用网络的仓库(本地仓库),你也可以把数据push
到github
Up (remote warehouse).Your current
pull
和push
is all data interaction between the local version library and the remote warehouse.In your local warehouse, it actually consists of two parts:
(Working Directory)
//Visible(Repository)
//Invisible(Stage)
(branch)
The repository contains staging area and branches
Process:
First submission:
- Use
git add
to move files to workspace ---》Staging area (local)- Move the file to the temporary storage area through
git commit
---》Branch (local)- by
git push
将文件 分支 ---》远程库 (github
)Submit changes:
- Move the file to the temporary storage area through
git commit
---》Branch (local)- by
git push
将文件 分支 ---》远程库 (github
)pull
&push
- Move the file to the remote library through
git pull
---》Branch (local)- by
git push
将文件 分支 ---》远程库 (github
)The above two operations require changes and differences before they can be executed.
Therefore, it will prompt that the contents of the staging area and the remote library are consistent.
There should be no commit, that is, submission.
The use of git is roughly the following four steps.
I usually use the following commands.
git add .
git commit –a –m +msg
git push –u origin master
I have written a blog before, you can refer to it below, which has some simple instructions on these commands.
Easy to use command line git
status refers to the local status, showing the difference between the local workspace and the local warehouse
The files you created and the files you modified but did not submit (commit) are all displayed here. After submission, they will be empty
pull/push is a synchronization operation between the local warehouse and the remote warehouse, and up-to-date indicates that the local warehouse and the remote warehouse are synchronized
Try it
Submit to local first, then synchronize to remote
I just solved this problem. I found that there is an extra master in my branch, that is, there is a master and origin/master in the branch. I don’t know what the difference is. After switching the points, the submission is successful directly.