将本地文件推送到github repo中的目录
我在本地repo中有一个文件,我想将其推送到Github repo中的一个目录 我有以下文件:将本地文件推送到github repo中的目录,git,github,Git,Github,我在本地repo中有一个文件,我想将其推送到Github repo中的一个目录 我有以下文件: F:\Development\Python\Workspace\StringCalculator.py 我需要将此文件推送到我的回购协议的以下路径: https://github.com/Gouravchawla/PyCodeFiesta/tree/master/GUI 如何将文件推送到该位置?我在Git Shell中尝试了以下命令: $ git remote add newremote http
F:\Development\Python\Workspace\StringCalculator.py
我需要将此文件推送到我的回购协议的以下路径:
https://github.com/Gouravchawla/PyCodeFiesta/tree/master/GUI
如何将文件推送到该位置?我在Git Shell中尝试了以下命令:
$ 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
我非常感谢您在这方面提供的任何帮助和见解。您不能将单个文件推送到远程存储库中的目录。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