Is it possible to fast forward another branch without checking it out?

In git, I have a branch A . I create another branch B where I create few commits. Then I want to fast forward branch A to branch B .

I know that I can checkout A and do fast forward to the latest commit of B . This operation requires two modifications of working copy: the first to return to A and then revert working copy to B . If new commits on B contain a lot of changes, the operation could be quite slow.

Is it possible to do fast forward another branch without changing the working copy? (in other words, to move just the pointer of A )


Git provides the update-ref command for this purpose

git update-ref A B

Note: This command is one of the lower-level Git commands and does not provide any safeguards for you to keep from screwing yourself up. If B is not a fast-forward of A it will still update A, potentially making commits unreachable and subject to garbage collection.

链接地址: http://www.djcxy.com/p/23290.html

上一篇: 如何使用Android Studio在Android手机上安装应用程序?

下一篇: 是否有可能在未检查出的情况下快进另一个分支?