我這個「gittify.cmd」批處理文件,在我的工作目錄:.CMD批處理文件不推我的本地git的回購協議的GitHub
git status
git add --all
git status
set /p commitComment=Enter the Commit Comment:%=%
@echo git commit -m "%commitComment%"
git status
git push origin master
的問題是,它不是推的變化GitHub上。 ..但如果我通過命令手動輸入,它的工作沒有問題。
這是經過「混帳推起源大師」最後的命令:
C:\www\lantosistvan.com>git push origin master
github --credentials get: github: command not found
Username for 'https://github.com': <My username>
Password for 'https://<My username>@github.com':
github --credentials store: github: command not found
Everything up-to-date
在此之後,我需要從本地git的刪除與此命令的特定文件:
git reset HEAD <stucked file>
更新1:
這是我的路徑:
C:\Users\<My username>\AppData\Local\GitHub\PortableGit_<code>\bin
我可以在cmd和ConEmu中運行git沒有問題。
git config --global credential.helper
沒有顯示任何東西。
當我推送到GitHub時,我不使用SSH。我總是輸入我的用戶名和密碼。
更新2:
在我的電腦不同,GitHub和Git的Bash安裝在同一時間。 PATH只針對AppData下的GitHub文件夾。
更新3 - 解決方案:
出於某種原因,@echo造成的錯誤。它只是簡單的阻止提交。所以在git push origin master之前,我的工作目錄並不乾淨。刪除@echo解決了這個問題:
git status
git add --all
git status
set /p commitComment=Enter the Commit Comment:%=%
git commit -m "%commitComment%"
git status
git push origin master
我建議使用git-gui或GitExtensions作爲提交工具,並且實際檢查您將要提交的內容,以避免意外地提交遺留下來的垃圾文件和您不想包含的文件。我也建議不要推動每一個提交。相反,一旦任務完成就推送。任務可能需要一些獨立的工作單元,這些工作單元應該是單獨的提交。 – patthoyts 2014-12-11 20:24:20
我已經排除了node_modules文件夾和其他一些我不需要在.gitignore文件中推送的文件。感謝這些信息,我會照顧一個Sublime Text或Gulp的插件,它只是立即推送一個修改過的文件。 – Lanti 2014-12-11 20:38:16