git
个新手,曾经subversion
:
我已经做了一些本地更改,现在想推送,但是我得到了:
$ git push
Everything up-to-date
在Google进行快速搜索后,我发现:git push says everything up-to-date even though I have local changes,并认为 GREAT!,并开始按照接受的答案中的建议进行操作:
$ git log -1
#got the hash key
$ git checkout master
M util/logging/cp_logging.cpp
Already on 'master'
Your branch is up-to-date with 'origin/master'.
#Now I got nervous and verified with git status
#and git diff that my changes were still there
#just for safety I did a
$ git diff >save.patch
#followed by(as recommended):
$ git reset --hard 579823db25d2a821c2940608e9cb8122c2779b37
HEAD is now at 579823d Merge remote-tracking branch 'upstream/master'
#then I did a
$ git status
# and realized that my changes were gone!
如何将所做的更改(幸运地保存到save.patch中)恢复到本地工作副本中,然后将更改从此处推送到在线存储库中?我的更改是否应该不像我之前的git commit
那样在本地存储区中提交?
答案 0 :(得分:1)