1, create a local warehouse
Select a folder as a local warehouse, do the following (this operation will only add a .git
folder does not delete any files locally)
git init
2, first create a warehouse in the cloud
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 pull
down 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参数)