用于 Windows checkout 、分支、提交和 pull 更改的 Git gui

标签 git git-gui github-for-windows

自从过去 5 年以来,我一直在使用 SVN,我是 GIT 的新手,我对基本操作的 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 fetch ,它不会自动将新内容 merge 到您的本地分支。

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

git merge origin/master

Git 有一个快捷命令可以自动获取和 merge :git pull .这可能就是您正在寻找的。

关于用于 Windows checkout 、分支、提交和 pull 更改的 Git gui,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12391685/

相关文章:

gerrit - 如何从 Git GUI 推送提交到 Gerrit 上的代码审查?

git - 远程GitHub中的灰色图标是什么意思

eclipse - 如何配置 Eclipse EGit 以使用自定义代理设置?

git - 如何用 git gui 做一个 rebase?

git - 显示二进制文件是从哪个 git commit 编译的

Git 警告 : LF will be replaced by CRLF

git-commit - 适用于 Windows 的 GitHub : How to commit only a part of the file?

git - 使用 git 同步所有分支

git - 如何在 git 中定义 ESC 字符?