Git --force-with-lease with + in branch (refspec)

后端 未结 2 1476
鱼传尺愫
鱼传尺愫 2021-01-13 23:09

On current Git, is there a material difference between git push --force-with-lease origin +somebranch, git push --force-with-lease origin somebranch

2条回答
  •  野的像风
    2021-01-13 23:39

    which would one should prefer by default when I like to pull to work branch via git pull --rebase origin master?

    I reported on force-with-lease in 2013 for git 1.8.5, and March 2016 for git 2.8".

    I would say... none of them.
    A pull --rebase is done to avoid having to force push (with or without lease) anything.

    I simply set (since git 2.6)

    git config pull.rebase true
    git config rebase.autoStash true
    

    That allows me do do some simple git pull, followed by simple git push (no forced push involved)

提交回复
热议问题