我有一个公共存储库.没有其他人分叉,拉扯或做任何其他事情.我对一个文件做了一些小改动,成功提交了它们,并试图推送.它说"一切都是最新的".没有分支.我对git非常非常新,我不明白到底是怎么回事.
git remote show origin 告诉我:
HEAD branch: master
Remote branch:
master tracked
Local ref configured for 'git push':
master pushes to master (up to date)Run Code Online (Sandbox Code Playgroud)
我有什么想法可以让它理解它不是最新的?
谢谢
更新
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
更新2:我重新打开修改后的文件,我知道的修改已经消失了.所以我再次加入他们,通过对rigamarole去git status,git add filename,git commit -m "(message)",和git push origin master,然后突然它的工作原理它应该的方式.
更新3:git reflog输出:
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
Joh*_*ohn 14
尝试
git config push.default tracking
Run Code Online (Sandbox Code Playgroud)
http://git-scm.com/docs/git-config:
push.default
如果在命令行上没有给出refspec,在远程中没有配置refspec,并且命令行上给出的任何选项都没有暗示refspec,则定义git push应采取的操作.可能的值是:
* 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.
Run Code Online (Sandbox Code Playgroud)
Tom*_*Tom 12
编辑:这似乎不是正确的解决方案,请参阅问题的评论.我要离开答案,因为git add而不是git commit -a提示可能会帮助将来的某个人.
您好,在您提交之前添加了吗?就像是
git add .
Run Code Online (Sandbox Code Playgroud)
(别忘了点)
之前
git commit -m "what you changed"
Run Code Online (Sandbox Code Playgroud)
(我觉得这个网站很有用 - http://gitref.org/remotes/#push)
| 归档时间: |
|
| 查看次数: |
24505 次 |
| 最近记录: |