我有一个我想要推送的Django项目(从git repo到服务器)
项目名称为:projectname
帐户名称为gitlab.com/projectname/django
我尝试推送时遇到此错误:
error: 'projectname' appears as both a file and as a directory
error: projectname: cannot drop to stage #0
error: Pull is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
答案 0 :(得分:1)
在全新的文件夹中(当前仓库之外)再次尝试全部流程:
cd /another/folder
git clone https://gitlab.com/projectname/django
cd django
然后将以前projectname / django文件夹的内容复制到新的django文件夹中。
Finally:
cd /another/folder/django
git push
实际上,OP正在使用ssh网址,并且必须遵循&#34; GitLab and SSH keys &#34;使它工作。
答案 1 :(得分:0)
你能试试吗?
git add projectname
git commit -m "Fixing 'projectname appears as both a file and as a directory' error"
git push origin master