【发布时间】:2015-07-12 10:58:41
【问题描述】:
我偶尔会被 git 的行为所困扰。据我了解我在下面做了什么,我在远程存储库上获取了当前版本的“公共”分支,并用它替换了我拥有的所有东西。我正在做的任何事情都不应该在那里。
然后我再次从远程存储库中提取“公共”。瞧!现在我在本地提前提交。
你能告诉我发生了什么吗?
[edit] 人们非常恰当地问我使用的是什么版本的 git。 2.1.4 我在下面的代码部分添加了一个 git --version。
rhedin@RHEDIN1-T430 ~/gogo/portal/gogo_flightTracker (public)
$ git status
# On branch public
# Your branch is ahead of 'origin/public' by 1 commit.
#
nothing to commit (working directory clean)
rhedin@RHEDIN1-T430 ~/gogo/portal/gogo_flightTracker (public)
$ git reset --hard origin/public
HEAD is now at 30cdb42 Remove O/D from window display if 640px window.innerWidth or less
rhedin@RHEDIN1-T430 ~/gogo/portal/gogo_flightTracker (public)
$ git status
# On branch public
nothing to commit (working directory clean)
rhedin@RHEDIN1-T430 ~/gogo/portal/gogo_flightTracker (public)
$ git pull origin public
\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\" get: -c: line 0: syntax error near unexpected token `('
\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\" get: -c: line 0: `\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\" get'
Username for 'https://github.com':
Password for 'https://rickhedin@github.com':
\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\" store: -c: line 0: syntax error near unexpected token `('
\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\" store: -c: line 0: `\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\" store'
From https://github.com/gogoit/gogo_flightTracker
* branch public -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Fast-forwarded public to 2e65060cef06715081e54f776e0f7269e8d65ba7.
rhedin@RHEDIN1-T430 ~/gogo/portal/gogo_flightTracker (public)
$ git status
# On branch public
# Your branch is ahead of 'origin/public' by 1 commit.
#
nothing to commit (working directory clean)
rhedin@RHEDIN1-T430 ~/gogo/portal/gogo_flightTracker (public)
$
rhedin@RHEDIN1-T430 /cygdrive/c/work/150502
$ git --version
git version 2.1.4
【问题讨论】:
-
你用的是什么版本的git? (它似乎在 Windows 上,我不知道有关 Windows 化 git 变体的任何细节,但 git 对
pull的行为在 git 1.8.4 中发生了变化,所以这可能对任何 can i> 回答特定于 Windows 的项目。)
标签: git