gpt4 book ai didi

git - 使用跟踪的远程分支的更改更新本地分支

转载 作者:IT王子 更新时间:2023-10-29 00:32:13 27 4
gpt4 key购买 nike

我有一个名为“my_local_branch”的本地分支,它跟踪一个远程分支 origin/my_remote_branch

现在,远程分支已更新,我在“my_local_branch”上并希望引入这些更改。我应该这样做吗:

git pull origin my_remote_branch:my_local_branch

这是正确的方法吗?

最佳答案

您不使用 : 语法 - pull 总是修改当前 checkout 的分支。因此:

git pull origin my_remote_branch

当您 checkout my_local_branch 时,将执行您想要的操作。

因为您已经设置了跟踪分支,所以您甚至不需要指定 - 您可以这样做...

git pull

当您 check out my_local_branch 时,它将从跟踪的分支更新。

关于git - 使用跟踪的远程分支的更改更新本地分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11278497/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com