git - git push 显示所有最新信息
问题描述
git
新手在这里,曾经subversion
:我已经提交了一些本地更改,现在想要推送,但我得到了:
$ git push
Everything up-to-date
快速谷歌搜索后,我发现:git push 说一切都是最新的,即使我有本地更改并且我认为很棒!并开始遵循已接受答案中的建议:
$ 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
那样)?
解决方案
推荐阅读
- spring - 无法通过 Spring LDAP 获取 Active Directory 记录的修改上下文
- reactjs - Prime React 数据表组件从数组到 JSON 的数据转换?
- authentication - 无法在 Keycloak 中将 Google 帐户链接到 Facebook 帐户,反之亦然
- django - 保存到数据库后如何获取对象
- wordpress - 按尺寸过滤未显示 WooCommerce 中过滤器下的所有产品
- linux - 有选择地为特定参数记录内核 Ftrace 点
- java - 为什么 Java 将某些 IPv6 地址解释为 IPv4?
- react-native - 如何在 React Native 中使用 apisauce 下载 pdf 文件?
- javascript - Shopify API - 使用选择字段使用 javascript 更新所选变体
- python - 为什么在尝试获取 txt 文件的文件路径时出现“权限被拒绝”?