Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] git: Your branch and 'origin/master' have diverged, and have 1 and 3 different commits each, respectively.

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
MakeTopSite
Posts: 112
Joined: 2021-01-20 08:44
Has thanked: 8 times

[Solved] git: Your branch and 'origin/master' have diverged, and have 1 and 3 different commits each, respectively.

#1 Post by MakeTopSite »

... after I had removed last 3 commits and pushed to remote:

Code: Select all

git reset HEAD^ --hard
git reset HEAD^ --hard
git reset HEAD^ --hard
git push https://gitlab.com/myname/myproj  -f

Code: Select all

git status
On branch master
Your branch and 'origin/master' have diverged,
and have 1 and 3 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

nothing to commit, working tree clean
What will happen please if I run

Code: Select all

git pull
?
Last edited by MakeTopSite on 2023-11-12 08:35, edited 1 time in total.

MakeTopSite
Posts: 112
Joined: 2021-01-20 08:44
Has thanked: 8 times

Re: git: Your branch and 'origin/master' have diverged, and have 1 and 3 different commits each, respectively.

#2 Post by MakeTopSite »

output of

Code: Select all

git pull
was empty but it has solved the problem.

Post Reply