所以我有一个分支develop
,并从中创建了一个新分支git checkout -b syntax_highlight
。
问题是,当我去我的新分支时,新分支中Gemfile
的我与父分支不同。
就像我Gemfile
在后台打开的一样,当我切换分支时我可以看到它发生了变化。
然而,没有任何上演。
$ git checkout syntax_highlight
Already on 'syntax_highlight'
$ git rebase develop
Current branch syntax_highlight is up to date.
$ git checkout develop
Switched to branch 'develop'
$ git checkout syntax_highlight
Switched to branch 'syntax_highlight'
$ git checkout develop
Switched to branch 'develop'
$ git status
# On branch develop
nothing to commit (working directory clean)
$ git checkout syntax_highlight
Switched to branch 'syntax_highlight'
$ git status
# On branch syntax_highlight
nothing to commit (working directory clean)
对于我的生活,我无法弄清楚为什么我的存在差异,Gemfile
这让我想知道是否还有 git 没有告诉我的其他差异。
编辑 1
在两个分支上运行后git log
,您将看到两者都有相同的提交,只是该syntax_highlight
分支有 1 个最近的提交 - 这是有道理的,因为那是我当前正在处理的分支。
$ git log
commit a0b320a001cb24f42e2cf0f3dfee38cfd53e2290
Author: marcamillion
Date: Thu Mar 28 02:27:08 2013 -0500
Got the HABTM counter_cache working.
commit 64b73338c34259f02daa2ed943bd5d47ac5bacc0
Author: marcamillion
Date: Mon Mar 25 03:16:43 2013 -0500
Added the basic sidebar layout.
commit 7989813e9a379e480500f12ee01367967b791cd4
Author: marcamillion
Date: Sun Mar 24 14:36:33 2013 -0500
Got the basics of the sidebar layout, along with the navigational bar listing useful tags.
commit 1f0feea2f6db36e5c89aaf83c51cfc3b4bdbf01f
Author: marcamillion
Date: Sun Mar 24 02:48:20 2013 -0500
Installed bullet gem.
##
$ git checkout syntax_highlight
Switched to branch 'syntax_highlight'
$ git log
commit cccc5cd3350dbcd751e1ceccd0d4865948fd6993
Author: marcamillion
Date: Thu Mar 28 03:02:20 2013 -0500
Installed pygments, but haven't been able to test successfully yet.
commit a0b320a001cb24f42e2cf0f3dfee38cfd53e2290
Author: marcamillion
Date: Thu Mar 28 02:27:08 2013 -0500
Got the HABTM counter_cache working.
commit 64b73338c34259f02daa2ed943bd5d47ac5bacc0
Author: marcamillion
Date: Mon Mar 25 03:16:43 2013 -0500
Added the basic sidebar layout.
commit 7989813e9a379e480500f12ee01367967b791cd4
Author: marcamillion
Date: Sun Mar 24 14:36:33 2013 -0500
Got the basics of the sidebar layout, along with the navigational bar listing useful tags.
commit 1f0feea2f6db36e5c89aaf83c51cfc3b4bdbf01f
Author: marcamillion
Date: Sun Mar 24 02:48:20 2013 -0500
Installed bullet gem.
编辑 2
这是git diff
一个特定的结果:
$ git diff-tree --no-commit-id --name-only -r cccc5cd3350dbcd751e1ceccd0d4865948fd6993
Gemfile
Gemfile.lock
app/assets/stylesheets/pygments.css.erb
app/views/home/index.html.erb