Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
208 views
in Technique[技术] by (71.8m points)

git config - git is forcing to pull even i am the only one making changes in branch

I have one problem currently on WSL. I am using git - following scenario

- 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)

Can anybody help me with this? I have my global git user in git config defined. I am not sure why is this happening. Should I configure local user for git for each repo? (It happens on all repos I currently have. Note: I used this setup - wsl/git in the past and it worked ok - so i guess this is just some configuration issue)

UPDATE

message after push

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.
question from:https://stackoverflow.com/questions/65949201/git-is-forcing-to-pull-even-i-am-the-only-one-making-changes-in-branch

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...