即使我是唯一一个在分支中进行更改的人,git 也被迫拉

问题描述

我目前在 WSL 上遇到一个问题。我正在使用 git - 以下场景

- I checkout to branch1
- user1 did last commit in branch1
- I pull changes
- I make changes
- I add files and commit
- I try to push
- Git forces me to pull even there is no change since last pull
- I pull changes
- merge commit created
- in git there are 2 commits: 1st by user1 (with my changes),2nd by me (no changes,just merge commit)

有人可以帮我解决这个问题吗?我在 git config 中定义了我的全局 git 用户。我不确定为什么会这样。我应该为每个 repo 为 git 配置本地用户吗? (它发生在我目前拥有的所有存储库上。注意:我过去使用过这个设置 - wsl/git 并且它工作正常 - 所以我想这只是一些配置问题)

更新

推送后的消息

To xxx/xxx.git
 ! [rejected]        branch1 -> branch1 (non-fast-forward)
error: Failed to push some refs to 'git@xxx/xxx.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)