[Newbies] git 错误如何解决
Tofloor
poster avatar
一顾倾城
deepin
2021-04-25 02:29
Author

这个如何解决

 

Reply Favorite View the author
All Replies
thepoy
deepin
2021-04-25 05:14
#1

.idea的目录没有用啊,将.idea添加到 .gitignore 中忽略这个目录

Reply View the author
^9星守辰^
Moderator
2021-04-25 16:32
#2

这不是git错误,这是你的文件合

冲突了,自己去处理文件冲突

Reply View the author
deepinuser17
deepin
2021-04-25 20:59
#3

py3code.iml 和 misc.xml 文件有本地修改.

 

用文本文件编辑器(vim, deepin-editor)打开这两个文件, 打开以后, 可以看到本地修改, 已及上游主分支的相关程序行. 保留想要的内容, 存文件就可以了.

 

使用git时, 最好用分支(branch), 这样不会和主干支(master branch)产生冲突.

 

例如, 复制到本地, 并用分支做开发, 修改.

1. 复制源到本地:

cd work
git clone git@gitee.com:software/py3code.git

2. 进入本地工作区

cd py3code
git branch


3. 创建一个新的分支 (假设分支名叫 20210425_py3code.iml)

git checkout -b 20210425_py3code.iml
git status

4. 修改, 编辑所需要的文件, 并保存.

5. 加入修改的文件, 并commit

git add -A .
git commit -m "20210425_py3code.iml changes bla bla"

6. 与本地主干支合并, 并推向远端的源

git checkout master
git merge 20210425_py3code.iml
git push origin master



 

 

Reply View the author
jasonyin-000
deepin
2021-04-27 06:55
#4
^9星守辰^

这不是git错误,这是你的文件合

冲突了,自己去处理文件冲突

Reply View the author