Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
488 views
in Technique[技术] by (71.8m points)

git - 将分支指针移动到不同的提交而不签出(Move branch pointer to different commit without checkout)

To move the branch pointer of a checked out branch, one can use the git reset --hard command.

(要移动已签出分支的分支指针,可以使用git reset --hard命令。)

But how to move the branch pointer of a not-checked out branch to point at a different commit (keeping all other stuff like tracked remote branch)?

(但是如何移动未检出分支的分支指针指向不同的提交(保留所有其他东西,如跟踪的远程分支)?)

  ask by Mot translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
git branch -f <branch-name> <new-tip-commit>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...