常用命令
我在d盘建了目录为
D:\Git项目目录
常用的操作为
1、先把远程仓库克隆到本地
Administrator@DESKTOP-S685CSN MINGW64 /d/Git项目目录/cloudimage (master)
$ history
1 git clone https://gitee.com/orange777/git-test.git
2 git clone https://gitee.com/orange777/cloudimage.git
3 cd cloudimage/
2、本地变动添加到远程仓库
4 git add .
5 git commit -m "提交测试"
6 git push origin master
3、删除远程仓库文件
1 git rm python提取复制图片.py
2 git commit -m "本地提交删除命令删除文件 python提取复制图片.py"
3 git push
4、当远程仓库内容变动,而本地没有时候,需要先pull到本地
git pull origin master
另外说一下
git push
和git push origin master
的区别
git push origin master 指定远程仓库名和分支名
git push 不指定远程仓库名和分支名
这两者的区别:git push是git push origin master的一种简写形式
1)当只关联一个远程,只有一个分支时,这两个命令没什么区别;
2)当你关联了两个多个仓库、有多个分支时,git push可能会报错,因为它不知道要上传代码到哪里去;
而git push origin master指定仓库和分支,就不会报错。
参考:
https://blog.csdn.net/gxx_csdn/article/details/78906910
https://www.pianshen.com/article/4946916082/
https://gitee.com/help/articles/4181#article-header0
https://blog.csdn.net/qq1291917670/article/details/114678692
https://blog.csdn.net/qq_41166909/article/details/120022805
https://www.cnblogs.com/einstein-2014731/p/11492637.html
https://blog.csdn.net/gxx_csdn/article/details/78913936
https://blog.csdn.net/qq_41166909/article/details/120022805