git 工作中常用的命令

git init                 初始化项目

git show             查看最近一次commit的相关信息

git branch -a #查看所有分支

git branch -r #查看远程分支

git branch -vv #查看本地分支所关联的远程分支

git branch -m old_branch new_branch # Rename branch locally

git push origin :old_branch # Delete the old branch

git checkout -b dev remotes/origin/dev         创建本地分支dev , 追踪远程分支   remotes/origin/dev

git branch -u remotes/origin/dev dev             同上

git push --set-upstream origin new_branch 或者 git push -u origin new_branch# Push the new branch, set local branch to track the new remote

git branch --set-upstream-to=origin/daiguojin/feature-spm-797 //将本地分支my-test关联到远程分支my-test上

git rebase -i master

git rebase bugFix master

git config --global credential.helper store        避免每次pull/push都要输入帐号和密码

git merge --abort    安全地撤销合并

git rebase --edit-todo     如果你异常退出了 vi 窗口,输入这个命令返回

gitlab 密码修改后需要运行  git config --global credential.helper wincred 重新输入帐号密码即可

  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

戴国进

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值