【问题标题】:Git gui for windows checkout, branching, commit and pull changes用于 Windows 签出、分支、提交和拉取更改的 Git gui
【发布时间】:2012-09-12 15:32:04
【问题描述】:

自从过去 5 年以来,我一直在使用 SVN,我是 GIT 的新手可以回答我的问题。

我使用 GIT GUI 成功完成的步骤。

Step 1- I create two folders on the c: Project-clone-1 and project-clone-2
Step 2- Then i clone Project1(which is on github cloud public server) in 'Project-clone-1' then in 'project-clone-2'

What i want to achieve by creating two copies of same repository is to observe if i commit any change from 'Project-clone-1' and then would like to go to 'project-clone-2' to pull and see if changes comes there.

Step 3- i made some change in a file which is inside 'Project-clone-1' i commit and then pushed.

Please remember i have only master branch.
Step 4- Then i went to the 'project-clone-2' from git GUI i do remote -> Fetch from -> origion
Step 5- it shows Fetching new changes from origin master-> orgin-> master (done)
Step 6- when i opened file which i expect to have change in 'project-clone-2' i still see old file ???

当我进行更新时,它没有显示远程更改,我错过了什么吗?

感谢您提前提供的帮助。

【问题讨论】:

    标签: git git-gui github-for-windows


    【解决方案1】:

    当您git fetch 时,它不会自动将新内容合并到您的本地分支中。

    假设您正在尝试将您的 master 分支与名为 origin 的远程同步。当您 git fetch 时,它会获取远程仓库上 master 分支的最新更改并将它们存储在 origin/master 分支(在您的本地仓库中)。这使您有机会在将更改合并到本地分支之前查看更改(例如,使用diff)。要将这些更改合并到您的本地 master 分支中,您可以(在主分支中):

    git merge origin/master

    Git 有一个自动获取和合并的快捷命令:git pull。这可能就是您正在寻找的。​​p>

    【讨论】:

    • git pull 在我执行 'git checkout' 之前也不会显示远程更改
    • 这意味着你还没有进入 master 分支,这很奇怪。我建议跳过 GUI 并使用命令行,尤其是在学习 Git 时。 GUI 倾向于混淆事物——更改名称、组合命令等。这使得理解 Git 实际在做什么变得更加困难。不过,很高兴你明白了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-05-05
    • 1970-01-01
    • 2018-05-14
    • 2016-12-20
    • 2014-09-01
    • 2017-11-04
    • 2017-12-05
    相关资源
    最近更新 更多