2015-12-22 15 views
1

推動本地文件到一個目錄我在我的本地回購文件,我要推到一個目錄在我的GitHub庫。在GitHub庫

我有以下文件:

F:\Development\Python\Workspace\StringCalculator.py 

我需要這個文件推到我的回購以下路徑:

https://github.com/Gouravchawla/PyCodeFiesta/tree/master/GUI 

如何將文件推到這個位置?我曾嘗試在Git的程序中運行以下命令:

$ git remote add newremote https://github.com/Gouravchawla/PyCodeFiesta/tree/master/GUI 
$ git push newremote master 

當我執行上面的命令,我收到以下錯誤:

fatal: repository 'https://github.com/Gouravchawla/PyCodeFiesta/tree/master/GUI/' not found 

我真的很感激任何形式的幫助和洞察力在這個問題上。

回答

3

不能單一文件推送到遠程倉庫裏面的目錄。 Git使用完整的目錄快照,你只能推送提交(歷史)。

所以,讓你的文件到你的倉庫,你必須創建一個提交包含文件:

git clone https://github.com/Gouravchawla/PyCodeFiesta 
cd PyCodeFiesta 
cp 'F:\Development\Python\Workspace\StringCalculator.py' GUI/ 
git add GUI/StringCalculator.py 
git commit -m 'Added StringCalculator file' 
git push origin master:master 
+0

沒關係。得到它了。非常感謝。 –