git - SmartGit pull 不像预期的那样

标签 git smartgit

我在 GitHub 上创建了一个仓库。

然后我通过 SmartGit 将我的 fork 克隆到本地开发环境中的一个文件夹中。 此外,我将原始存储库添加为远程。

现在,原始存储库已添加和更改了一些文件。我想检索这些,以便在继续开发之前了解最新情况。

我按下 SmartGit 中的 Pull 按钮并在对话框中选择原始存储库。 SmartGit 将此返回给我:

remote: Counting objects: 24, done.
remote: Total 13 (delta 7), reused 12 (delta 6)
From github.com:Original/repo
 * [new branch]      master     -> lm/master

但是,添加的文件和更改没有添加到我的本地存储库中。 使用 Git Bash 手动执行此操作 - git pull original master 一切正常。

为什么 SmartGit 没有像我预期的那样 pull ?

最佳答案

Pull 上,SmartGit 将执行“git fetch”,然后 merge resp。重新设置跟踪的分支。在您的情况下,master 跟踪 origin/master,而不是 lm/master。您现在有以下选择,始终假设您在 master 上:

(1) 配置master跟踪lm/master而不是origin/master:调用Branch|Branch Manager,选择 master,从上下文菜单中调用 Reset Tracked Branch,然后将 lm/master 添加到选择中并调用 Set跟踪分支。现在,它是 lm/master,它将在每次 Pull 时被 merge (或重新定位)。

(2) 手动 merge lm/master:调用Branch|Merge并选择lm/master

(3) 手动 rebase 到 lm/master:调用 Branch|Rebase,选择 HEAD to selected commits 并在图表页面上, 选择 lm/master

关于git - SmartGit pull 不像预期的那样,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10495624/

相关文章:

git - git 有什么了不起的?

Git 推送在 Git Bash 中有效,但在 SmartGit 或 TortoiseGit 中无效

smartgit - 如何在 SmartGit 中暂存一行?

git - 如何解除 git 文件夹的嵌套?

git - 使用 Gitlab Ci Cd 将文件添加到存储库

git - VS 团队资源管理器 merge 冲突

git - fork git 分支并使用 SmartGit 查看它们

git - 在 Git 中推送主分支时,也会推送来自开发分支的提交。这应该发生吗?我正在使用 Gitflow

git - .gitignore 排除包含文件的文件夹但包含子目录

git - 致命的 : could not read Username for 'https://gitlab.com' : terminal prompts disabled