簡體   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