繁体   English   中英

Git提交挂在1kb文件提交上

[英]Git commit hanging on 1kb file commit

环境:使用Git CMD的Win8.1

因此,我一直试图在Windows计算机上确定Git脆弱性。 我能够将远程存储库克隆到新的新目录中。 如果有任何区别,则在我的Mac上创建github repo内容。 我将一个1kb的文本文件添加到Windows本地,名为Add_file.txt。 我似乎能够添加文件,但如果没有git commit挂起,则无法提交文件。

我如何追踪幕后发生的事情,弄清楚为什么我无法做到这一点? 我曾多次尝试执行此程序而死机。 如果我此时杀死ctrl + c,则会保留一个git锁定文件,以防止在本地执行任何其他git命令。 删除git锁定文件并不能解决无法提交git的问题。

有任何想法吗?

    C:\Users\mylocaluser\Documents\GitHub>git clone https://github.com/mygitaccount/99_Gitbug.git
    Cloning into '99_Gitbug'...
    remote: Counting objects: 11, done.
    remote: Compressing objects: 100% (7/7), done.
    remote: Total 11 (delta 1), reused 11 (delta 1), pack-reused 0
    Unpacking objects: 100% (11/11), done.

    C:\Users\mylocaluser\Documents\GitHub>cd 99_Gitbug
    C:\Users\mylocaluser\Documents\GitHub\99_Gitbug>git status
    On branch master
    Your branch is up-to-date with 'origin/master'.
    Untracked files:
      (use "git add <file>..." to include in what will be committed)

            Add_file.txt

    nothing added to commit but untracked files present (use "git add" to track)

    C:\Users\mylocaluser\Documents\GitHub\99_Gitbug>git add Add_file.txt

    C:\Users\mylocaluser\Documents\GitHub\99_Gitbug>git status
    On branch master
    Your branch is up-to-date with 'origin/master'.
    Changes to be committed:
      (use "git reset HEAD <file>..." to unstage)

            new file:   Add_file.txt


    C:\Users\mylocaluser\Documents\GitHub\99_Gitbug>git commit -m "6th commit to local WIN repo"

我确信这是新问题,但是对于跟随我学习git的可怜人来说,这是我在WIN8.1机器上遇到的解决方案。 示例代码中包含每个git命令的确切语法。

1)如果在Windows计算机上克隆远程存储库失败,请尝试使用HTTP而不是HTTPS远程URL进行存储库。 HTTPS完全克隆对我来说失败了。

    > git clone http://github.com/Agent-Sesame/99_Gitbug.git

2)如果您发现Windows上的git commit挂起并失败,请尝试在您的提交状态消息中用'勾号而不是“引号引起来。有关此约定的棘手部分是git on似乎支持” Mac OSX。

    > git commit -m '6th commit from WIN'

祝你好运

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM