From 0 to 1, to a local remote procedure git
- Remember must be submitted in a file folder code
git init
, not only what you use
tortoisegit what tools, or you are in an environment already add the idea, but you still need to right-click the folder in the current filegit bash here
, provided that you do not need to idea you submit to the warehouse or, idea warehouses need to be replaced, do not apply. - When
git init
later, can be found in the folder appears under the.git
hidden files, then you cangit status
view the contents of the current folder:
- After a review is complete, if you need to submit single or multiple files using the time
git add 文件1,文件2,。。。
but if you are required to submit all the documents directlygit add .
submit all documents as:
- After submission, you should commit to your local repository: git commit -m remarks information, attention to the need quotation marks. Figure:
After adding to the local repository, and the need to associate the remote repository: It is recommended to use ssh to submit
git remote add origin ssh your name, you can directly copy over.
After linking remote repository, use push to a remote repository: This is only the first time you need to add the information u
git push -u orgin master
If there is follow-up documents need to be submitted to the remote library, you can use the command directly:
git push origin master
Summary
git init:初始化仓库
git add README.md:添加文件
git commit -m "first commit" 添加文件到本地仓库
git remote add origin [email protected]:mlh1421/baidu-mission.git : 关联远程仓库
git push -u origin master 第一次提交到远程仓库的文件
git push origin master:第二次+n提交到远程仓库的文件