使用git管理gitee常用命令

常用命令

我在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 pushgit 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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值