当git push确实不是最新的时候,它会说一切都是最新的 [英] git push says everything up to date when it definitely is not

查看:127
本文介绍了当git push确实不是最新的时候,它会说一切都是最新的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个公共存储库。没有其他人分叉,拉扯,或做任何事情。我对一个文件做了一些小改动,成功提交了这些文件,并尝试推送。它说'一切都是最新的'。没有分支。我对git非常非常陌生,我不明白到底发生了什么。



git remote show origin 告诉我:

  HEAD分支:master 
远程分支:
跟踪的主数
为'git push'配置的本地ref:
主人推送给主人(最新)

任何想知道我可以做些什么来使它明白它不是最新的?



谢谢

更新:
git status

#分支主
#未追踪文件:
#(使用git add ...包含将要提交的内容)

#histmarkup.el
#vendor / yasnippet-0.6.1c / snippets /
没有更改添加到提交(使用git add和/或git commit -a)

git分支-a

 * master 
遥控器/ origin / master

git fsck

悬空树105cb101ca1a4d 2cbe1b5c73eb4a238e22cb4998 
悬挂树85bd0461f0fcb1618d46c8a80d3a4a7932de34bb更新2:我重新打开了修改过的文件,并且我所知道的修改已经消失。所以我再次添加它们,通过 git status git add filename git commit -m(message) git push origin master ,并且它突然按照它应该的方式工作。 / p>

更新3: git reflog 输出:

 009251 HEAD @ {0}:commit:添加复制/粘贴键绑定
06920f9 HEAD @ {1}:commit:次要.gitignore调整
84aa30c HEAD @ {2}:结帐: master
84aa30c HEAD @ {3}:结帐:从ec16cca979045547a5444e20f48ed468dee81dd4移动到master
ec16cca HEAD @ {4}:commit:为复制/粘贴添加了keybindings
5c4a611 HEAD @ {5}:commit :记住模式键绑定到MR
f3e4729 HEAD @ {6}:commit:更正抹去某些东西的最后一个按钮
fa28a3e HEAD @ {7}:结帐:从主控移动到fa28a3ed80eb0c6d4375ae77060d5cb4143d6a8e ^ 0
84aa30c HEAD @ {8}:commit:已修改的键绑定,添加了LaTeX钩子
10e7718 HEAD @ {9}:commit:添加了几个键绑定
d62378b HEAD @ {10}:commit(initial):first commit


解决方案

尝试

  git config push.default跟踪

http://git-scm.com/docs/git -config

push.default



定义git push在没有refspec是在命令行中给出的,在远程中没有配置refspec,并且在命令行上给出的任何选项都没有暗示refspec。可能的值是:

  * nothing  - 不推送任何东西。 
*匹配 - 推送所有匹配的分支。所有在两端具有相同名称的分支都被认为是匹配的。这是默认设置。
* upstream - 将当前分支推送到其上游分支。
* tracking - 不赞成使用upstream的同义词。
* current - 将当前分支推送到同名的分支。


I have a public repository. No one else has forked, pulled, or done anything else to it. I made some minor changes to one file, successfully committed them, and tried to push. It says 'Everything up-to-date'. There are no branches. I'm very, very new to git and I don't understand what on earth is going on.

git remote show origin tells me:

HEAD branch: master
  Remote branch:
    master tracked
  Local ref configured for 'git push':
    master pushes to master (up to date)

Any ideas what I can do to make this understand that it's NOT up to date?

Thanks

Updates: git status:

# On branch master
# Untracked files:
#   (use "git add ..." to include in what will be committed)
#
#       histmarkup.el
#       vendor/yasnippet-0.6.1c/snippets/
no changes added to commit (use "git add" and/or "git commit -a")

git branch -a:

* master
  remotes/origin/master

git fsck:

dangling tree 105cb101ca1a4d2cbe1b5c73eb4a238e22cb4998
dangling tree 85bd0461f0fcb1618d46c8a80d3a4a7932de34bb

Update 2: I re-opened the modified file, and the modifications I KNOW I had made were gone. So I added them again, went through the rigamarole of git status, git add filename, git commit -m "(message)", and git push origin master, and all of a sudden it works the way it's supposed to.

Update 3: git reflog output:

009251 HEAD@{0}: commit: added copy/paste keybindings
06920f9 HEAD@{1}: commit: Minor .gitignore tweak
84aa30c HEAD@{2}: checkout: moving from master to master
84aa30c HEAD@{3}: checkout: moving from ec16cca979045547a5444e20f48ed468dee81dd4 to master
ec16cca HEAD@{4}: commit: Added keybindings for copy/paste
5c4a611 HEAD@{5}: commit: remember-mode keybinding to M-R
f3e4729 HEAD@{6}: commit: Correcting last push which wiped out some stuff
fa28a3e HEAD@{7}: checkout: moving from master to fa28a3ed80eb0c6d4375ae77060d5cb4143d6a8e^0
84aa30c HEAD@{8}: commit: Modified keybindings, added LaTeX hook
10e7718 HEAD@{9}: commit: Added a few keybindings
d62378b HEAD@{10}: commit (initial): first commit

解决方案

Try

git config push.default tracking

http://git-scm.com/docs/git-config :

push.default

Defines the action git push should take if no refspec is given on the command line, no refspec is configured in the remote, and no refspec is implied by any of the options given on the command line. Possible values are:

* nothing - do not push anything.
* matching - push all matching branches. All branches having the same name in both ends are considered to be matching. This is the default.
* upstream - push the current branch to its upstream branch.
* tracking - deprecated synonym for upstream.
* current - push the current branch to a branch of the same name.

这篇关于当git push确实不是最新的时候,它会说一切都是最新的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆