Local git repository to create and connect to a remote GitHub

1, create a local warehouse

Select a folder as a local warehouse, do the following (this operation will only add a .gitfolder does not delete any files locally)

git init

2, first create a warehouse in the cloud

Here Insert Picture Description
Here Insert Picture Description
Fill in the back according to their actual situation can be very simple, the main open source protocol, it is recommended to look.

3, connecting remote repository

git remote add origin https://github.com/yourName/repositoryname.git

4, synchronous remote warehouse

First of all to a remote repository file pulldown in order push.

git pull origin master

5, the code will be submitted to the local repository remote

git add .                    将所有文件加到缓存区,.代表所有文件
git commit -m "commnet"      提交更改,添加备注信息
git push origin master       将本地仓库的文件push到远程仓库(强烈不建议添加 -f参数)
Published 141 original articles · won praise 131 · views 210 000 +

Guess you like

Origin blog.csdn.net/qq_41621362/article/details/104210072