关于git的一些记录

下载代码:
在一个新建一个文件夹,cmd(git bash)
git clone URL(eg:)https://gitee.com/rookie-white/media/tree/master/

提交代码
git add .

git commit -m “描述”

git push

$ git config -global user.name <name> #设置提交者名字
$ git config -global user.email <email> #设置提交者邮箱
$ git config -global core.editor <editor> #设置默认文本编辑器
$ git config -global merge.tool <tool> #设置解决合并冲突时差异分析工具
$ git config -list #检查已有的配置信息
$ git add . #添加所有改动过的文件
    // 如果想忽略某个文件,需要新建一个.gitignore文件,写入想忽略的文件名称

$ git add <file> #添加指定的文件
$ git mv <old> <new> #文件重命名
$ git rm <file> #删除文件
$ git rm -cached <file> #停止跟踪文件但不删除
$ git commit -m <file> # 提交指定文件
$ git commit -m “commit message” #提交所有更新过的文件
$ git commit -amend # 修改最后一次提交
$ git commit -C HEAD -a -amend #增补提交(不会产生新的提交历史纪录)

// 一次完整的操作    1、git add filename
              2、git commit -m filename
                       
删除例   1、$ vim abc.txt    //先创建一个文件  //创建完之后如果不提交,git rm filename是无法操作的
      2、$ git add abc.txt //提交
      3、$ git commit abc.txt  //上传
          hint: Waiting for your editor to close the file...  会打开一个文件,图2.3 
      4、$ git rm abc.txt -f   //强制删除
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值