git提交没有文件名,没有-a [英] git commit without file name and without -a

查看:160
本文介绍了git提交没有文件名,没有-a的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,我输入了 git commit ,但没有我想到的文件名,发生了奇怪的事情。



通常它会告诉我使用文件名或-a,dummie,但这次显示:

  $ git commit -m一些变化
[master 1d75411]某些变化
37个文件已更改,1566个插入(+),1189个删除( - )
创建模式100644 fileA
创建模式100644 fileb
[...]
删除模式100644 fileC
删除模式100644 fileD
[...]

,并且这些更改已在服务器上显示!如果我做了 push merge !!!



<尽管我正在尝试提交文件,但所有内容都与以前完全一样。



没有文件被删除,没有文件被更改。 Unix权限和以前一样!



发生了什么?!






  $ git status 
现在,在每两次提交之后,发生这种情况: *没有任何改变*
$ git diff
* nothing *
$编辑某些文件
$ git commit -m一些变化somefile
[master f875c5b]一些变化
21个文件已更改,4个插入(+),1563个删除( - )
删除模式100644 fileA
删除模式100644 fileB
删除模式100644 fileC
[... ](somefile甚至不会出现在控制台输出上,只有当我以后得到日志时)

$ git status
#在分支主机上
#要提交的更改:
#(使用git reset HEAD< file> ...来取消)

#新文件:fileA
#新文件:fileB
#新文件:fileC
[...]

$ git commit -m重新添加文件?为什么?
$ git push

$ git status
*没有任何变化*

$ git diff
* nothing *

$ edit somefile

$ git commit -msome changesomefile
[master f875c5b]一些更改
更改了21个文件,4个插入(+),1563个删除( - )
删除模式100644 fileA
删除模式100644 fileB
删除模式100644 fileC
[...]

$ git status
#关于分支大师
#要提交的更改:
#(使用git reset HEAD< file> ...来取消)

#new file:fileA
#新文件:fileB
#新文件:fileC
[...]

就是这样。我只是认为我对git不够聪明,并且在Subversion中托管这个项目。在这个阶段不需要太多的历史记录,所以它现在可能会丢失。



在我有时间阅读完git书之后,我可以再给它一次。

感谢您的帮助,但这太奇怪了,并且没有任何实际意义。

好奇心到某人,我的工作流程到目前为止(两个月这样做,一切都很好,直到今天)

  $ git fetch 
$ git merge origin / master master
$ edit file
$ git add somenewfile
$ git commit -m'something changed'file somenewfile
$ git push


解决方案

由于没有人可以解释这一点,一个bug。



只要有人在将来搜索此文件即可。



我发送了日志对开发者来说,从来没有听到过,但由于在我使用的版本之后有一些修改,我只会假设它是固定的......但我永远不会知道因为不再使用这个项目的git。


Today i typed git commit without the file name i was thinking of, and strange things happened.

usually it would just tell me "use a filename or -a, dummie", but this time it showed:

$ git commit -m "some change"
[master 1d75411] some change
 37 files changed, 1566 insertions(+), 1189 deletions(-)
 create mode 100644 fileA
 create mode 100644 fileb
 [...]
 delete mode 100644 fileC
 delete mode 100644 fileD
 [...]

and those changes are already appearing on the server! like if i did a push or merge!!!

Everything is exactly the same as before despite the file i was trying to commit anyway.

No file was deleted, no file was changed. Unix permissions are the same as before!

What happened?!


Edit: now, after every two commits, this happens:

$ git status
 * nothing changed *
$ git diff
 * nothing *
$ edit somefile
$ git commit -m "some change" somefile
[master f875c5b] some change
 21 files changed, 4 insertions(+), 1563 deletions(-)
 delete mode 100644 fileA
 delete mode 100644 fileB
 delete mode 100644 fileC
 [...] (somefile does not even appear on the console output, only if i get log later)

$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   new file:   fileA
#   new file:   fileB
#   new file:   fileC
[...]

$ git commit -m "re-add files? why?"
$ git push

$ git status
 * nothing changed *

$ git diff
 * nothing *

$ edit somefile

$ git commit -m "some change" somefile
[master f875c5b] some change
 21 files changed, 4 insertions(+), 1563 deletions(-)
 delete mode 100644 fileA
 delete mode 100644 fileB
 delete mode 100644 fileC
 [...]

$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   new file:   fileA
#   new file:   fileB
#   new file:   fileC
[...]

That's it. i will just take that i'm not smart enough for git and host this project in Subversion. Do not need much history at this stage anyway, so it can be lost for now.

I may give it another go after i have the time to read the git book entirely.

thanks for trying to help, but this just got too weird and unproductive.

also, out of curiosity to someone, my work flow so far have been (two months doing this and everything was fine until today)

$ git fetch
$ git merge origin/master master
$ edit file
$ git add somenewfile
$ git commit -m 'something changed' file somenewfile
$ git push

解决方案

Since no one can explain this, i'm closing assuming it's a bug.

leaving here just if someone search this in the future.

i've sent the logs to the devs, never heard back, but since there's a few revisions after the one i was using, i will just assume it was fixed... but i will never know since not using git on this project anymore.

这篇关于git提交没有文件名,没有-a的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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