1.初始化本地仓库
新建一个文件夹,在文件夹内右键选择Git Bash Here ,在命令框内输入 git init , 这时新建的文件内会有一个隐藏文件夹.git
2.在GitHub上新建一个仓库
3.本地仓库与远程仓库建立联系
在命令框中输入 git remote add origin 远程仓库地址
建立连接之后可以使用 git remote -v 查看远程仓库
4. 可以给远端仓库重新命名,git remote rename oldname newname 这里叫mygit1
git remote rename origin mygit1
5.向远端仓库提交内容
(1)提交到暂存区 git add '文件名'
(2)提交到本地仓库 git commit -m '注释'
(3)git pull mygit1 master
(4)提交内容到远程仓库 git push mygit1 master
6.常用命令
git log 查看之前操作