我已经多次git提交代码时提交了不该提交的.

哪些代码我不想提交呢?

(1)假数据;

(2)mock(stub)数据

可是,git commit时,容易提交上去,特别是使用sourceTree时.如何避免呢?

方案:

步骤一:提交代码时,把不想提交的代码备份一份,然后再revert:
git提交代码时防止误提交
 

 

步骤二:执行commit
git提交代码时防止误提交
 

步骤三:把刚才备份的还原

参考:

对git分支如何应对紧急上线:http://hw1287789687.iteye.com/blog/2270314

Git 切换分支和merge分支 :http://hw1287789687.iteye.com/blog/2225077

相关文章:

  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-19
  • 2021-08-27
  • 2021-07-25
  • 2021-08-20
相关资源
相似解决方案