例如:
我想把本地dist文件夹('built'app文件)和push
文件带到我的一个github存储库中的文件夹中。即。 github.com/myacct/repositoryA/app
我当时想做点什么
cd path/to/my/local/localdevproject/dist // not git repo
git init
git push origin https://github.com/myacct/repoA.git/app
我尝试了它并且错误地指出refspec错误。试图从git中读取文档并且它们令人困惑。
答案 0 :(得分:1)
您可以将工作树暂时设置为另一个文件夹(包括您的dist
文件夹)
cd /local/path/of/your/repository/clone
git --work-tree=/path/to/parent/of/dist add dist
git mv dist folder1
git commit -m "Add dist to folder1"
git push
该解决方案中的主要命令是git --work-tree
,它允许更改工作树路径(同时,在此处,将git-dir保持为当前仓库)。
请参阅man git
page。