git常见问题
程序员文章站
2022-07-07 20:59:02
...
一、clone代码
-
clone
1.登录账号密码不对 fatal: Authentication failed for 2.权限不足 Permission denied (publickey) 或者emote: User permission denied fatal: unable to access url The requested URL returned error: 403
二、合并分支提交代码
-
合并
Push rejected: Push master to origin/master was rejected by remote 提交备注格式不对会拒绝 解决方法:
git log查看提交记录
回退到上个提交版本号 比如说这次提交的是不能push到远程仓库的 就回退到
git reset --soft e5463abfc600dac9b98c3541d1af56cc7fbf97c8 (不加--soft 会删除掉本地代码)
-
pull 代码冲突
Git Pull Failed You have not concluded your merge (MERGE_HEAD exists). Exiting because of unfinished merge.
解决办法:
方法一: git reset --merge 注:取消合并 方法二: git add 注:追加修改后的文件 方法三: git commit --amend 注:提交修改后的代码 方法四: git push +分支 注:提交到某个分支中
-
push不上去
1.问题:
提示Could Not Merge origin/master: You have not concluded your merge (MERGE_HEAD exists). 强行拉去合并不推荐。最好本地commit、 merge、然后pull然后push git pull origin master --allow-unrelated-histories
转载于:https://my.oschina.net/u/3730149/blog/3074956
上一篇: 别去*别人了