git使用

下载代码

 gitclone + url

Mast 下更换单分支: 

git checkout  feature/perf_409035(git 分支)

git checkout oms-P_6081

status –git status

  查看已暂存和未暂存的更新

add   --git add file

  跟踪新文件

pull   --git pull参数可省略

  更新代码

commit –git commit


  提交表示该文件已经被安全地保存在本地数据库中了


push – git push [remote-name] [branch-name]


  推送到远程分支


diff --git diff


  比较当前工作目录(working directory)和staging area(存储区域)的文件差别


rm  --git rm file


  删除文件,并且从暂存区删除


       --git rm--cached file 从暂存区删除

Git pull 更新代码

git提交流程: git pull——git status——git add——git commit(写注释,退出 : 点击ESC 然后输入 :wq)——git push 。

. 文件状态

  一般仓库中的文件可能存在于这三种状态:

    1)Untracked files → 文件未被跟踪;
    2)Changes to be committed → 文件已暂存,这是下次提交的内容;
    3) Changes bu not updated → 文件被修改,但并没有添加到暂存区。如果 commit 时没有带 -a 选项,这个状态下的文件不会被提交。

$git commit -a -m "commit info"

git commit -m "提交"  “”  注释内容

git commit: git commit 提交的是暂存区里面的内容,也就是 Changes to be committed 中的文件。

git commit -a 除了将暂存区里的文件提交外,还提交 Changes bu not updated 中的文件。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值