git:从非git存储库导入更改 [英] git: import changes from non git repository
问题描述
- 本地git回购,默认主分支
- 内容为repo(非git),每天与本地仓库同步,master分支
工作流程:
如何将所有在FTP上更改的文件导入本地git仓库并查看已更改的项目? b $ b
这听起来有点噩梦。我认为它不能在FTP服务器上拥有一个git仓库。在这种情况下,我会在工作库中创建一个单独的分支:
git checkout -b ftp
复制ftp并将其提交给分支:
git commit -a
然后回到master:
git checkout master
并从FTP分支进行正常的合并,比较,挑选。您可能想在合并完成后删除FTP目录。
Scenario:
- Local git repo, default master branch
- FTP server with content of the repo (non git), synchronized daily with the local repo, master branch
Workflow:
- user1 is working on local git repo (git add, working directory clean)
- user2 (non git user) changed files directly on the FTP server
How can I import all files changed on FTP to the local git repo and see what has changed?
It sounds a bit nightmarish. I assume it is no option to have a git repository on the FTP server. In that case I would create a separate branch in my work repository:
git checkout -b ftp
copy the ftp stuff over and commit it to the branch:
git commit -a
then go back to the master:
git checkout master
and do the normal merge, diff, cherry-pick from the FTP branch. You might want to delete the FTP directory after merging is done.
这篇关于git:从非git存储库导入更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!