如何根据官方存储库更新我克隆的存储库
How to update my cloned repository according to the official repository
我正在我的 gitkraken 中寻找一种方法来根据官方存储库更新我克隆的存储库。因为我克隆的存储库是在几次之前提交的。
Aside: Gitkraken and tools like it are useful, but the downside is that they often obscure what's actually going on. It's hard to understand what these tools are doing for you because of all the visual layers. I highly recommend learning the CLI commands first, and then using GUI tools for the convenience.
您的 remote 可能已经配置好,因为这是一个克隆。但最好检查一下以防万一:
> git remote -v
origin <your fetch location>
origin <your push location>
接下来,确保你的分支有上游。
> git status
On branch <your branch name>
Your branch is ahead of 'origin/<remote branch name>' by X commits.
如果您得到与上述类似的结果,那么您可以只使用 git pull
和 git push
获取新提交 from/send 新提交到您的远程仓库。
如果您没有得到类似于上述的结果,那么要么您还没有配置您的远程and/or您的本地工作分支没有上游分支。
有关将本地分支链接到远程分支的详细信息,请参阅 2.5 Git Basics - Working with Remotes for more information about setting up your remote and 3.5 Git Branching - Remote Branches。
有关使用遥控器和分支的 GitKraken-specific 文档,请参阅 GitKraken Support: Pushing and Pulling
我正在我的 gitkraken 中寻找一种方法来根据官方存储库更新我克隆的存储库。因为我克隆的存储库是在几次之前提交的。
Aside: Gitkraken and tools like it are useful, but the downside is that they often obscure what's actually going on. It's hard to understand what these tools are doing for you because of all the visual layers. I highly recommend learning the CLI commands first, and then using GUI tools for the convenience.
您的 remote 可能已经配置好,因为这是一个克隆。但最好检查一下以防万一:
> git remote -v
origin <your fetch location>
origin <your push location>
接下来,确保你的分支有上游。
> git status
On branch <your branch name>
Your branch is ahead of 'origin/<remote branch name>' by X commits.
如果您得到与上述类似的结果,那么您可以只使用 git pull
和 git push
获取新提交 from/send 新提交到您的远程仓库。
如果您没有得到类似于上述的结果,那么要么您还没有配置您的远程and/or您的本地工作分支没有上游分支。
有关将本地分支链接到远程分支的详细信息,请参阅 2.5 Git Basics - Working with Remotes for more information about setting up your remote and 3.5 Git Branching - Remote Branches。
有关使用遥控器和分支的 GitKraken-specific 文档,请参阅 GitKraken Support: Pushing and Pulling