阿神2017-05-02 09:21:16
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
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.
滿天的星座2017-05-02 09:21:16
There should be no commit, that is, submission.
The use of git is roughly the following four steps.
add->commit->fetch->pull->push
Change to Chinese
Add code->Submit code->Fetch code->Pull code->Push code
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
仅有的幸福2017-05-02 09:21:16
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
git commit -m '你的注释'
git push origin dev
Submit to local first, then synchronize to remote
天蓬老师2017-05-02 09:21:16
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.