develop process

-f Option is dangerous, make sure that only do this on your own branch

# When you starting coding at the first time, create a new branch which track the develop:
$ git fetch
$ git checkout -t origin/develop -b whatsThisBranchFor

# Coding...
$ git add && git commit $ git pull --rebase # Coding... # Fetch new code on origin/develop in the middle $ git stash $ git pull --rebase $ git stash pop # Coding... $ git add && git commit $ git pull --rebase # ... $ git push origin whatsThisBranchFor -f




When you want to do some minor changes in your existing commit, please re-commit with git commit --amend,

$ git log
commit 1 # Which you want to change
commit 2

# Coding...
$ git status
files1 changes
files2 changes

$ git add files1 $ git commit --amend # It will show "commit 1" in the editor, you can re-edit the message to "commit 1 new" if necessary, then save, exit $ git log commit 1 new # New changes of files1 has been included commit 2 # As you changes the commit, Git will warn you that the remote branch is diverged from your local one, # use '-f' option to force update, make sure that only do this on your own branch. $ git push origin whatsThisBranchFor -f

转载于:https://www.cnblogs.com/Brittany-yan/p/5549497.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值