pushandpop
pushandpop

Reputation: 505

Am I going to push to the same commits?

I was going to push my commits, but some error appeared and I'm lucky, bc as it shows I was going to push to the same commits (I think). I'm afraid that I'll broke something by pushing to double commits.

Why? Look at this:

[john@pc]$ git push
// useless stuff
Delta compression using up to 4 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (18/18), 2.63 KiB | 0 bytes/s, done.
Total 18 (delta 14), reused 0 (delta 0)

// here it goes
remote: Audit failure - Commit 3876b44 - Non-full name: johngitacc
remote: Audit failure - Commit 3876b44 - Non-full name: johngitacc
remote: Audit failure - Commit 6757f52 - Non-full name: johngitacc
remote: Audit failure - Commit 6757f52 - Non-full name: johngitacc

Why there 2x2 same commits: two of 3876b44 and two of 6757f52?
Can it be caused by the reason these commits was created in different local branches and then they were cherry-picked from that branches? AFAIK, no, bc I deleted these branches after cherry-picking, but "double-titles" still there. What can be the reason? Am I going to push the same commits?

P.S. I shortened the SHA-1s of commits for readability.

UPD.:

I ran git config user.name "John Pushandpop" command. Then git push and got the same output, but a little bit changed those 4 lines:

remote: Audit failure - Commit 3876b44 - Non-full name: John
remote: Audit failure - Commit 3876b44 - Non-full name: johngitacc
remote: Audit failure - Commit 6757f52 - Non-full name: John
remote: Audit failure - Commit 6757f52 - Non-full name: johngitacc

Upvotes: 0

Views: 305

Answers (2)

Ostap Maliuvanchuk
Ostap Maliuvanchuk

Reputation: 1175

You need to set your global user name with : git config --global user.name "Your name"

If you want to test what happens in case you push your commits to master you can just push them to new remote branch. But as @MadPhysicist said it should be OK.

Upvotes: 1

mgarciaisaia
mgarciaisaia

Reputation: 15610

There's no such thing as a duplicated commit - if it has the same hash, it's the same commit.

As they told you in the comments, it may be that the remote script is processing each commit twice because of an error or poor programming - who cares? As long as it detects the issue, it's not that relevant if it's informed twice.

But the other alternative that wasn't mentioned is you may be pushing two branches instead of one. Try doing git push origin master instead of just git push to see if this is the case.

If it is, you may want to change the push.default config to something like current so git push only pushes the current branch to it's remote counterpart.

Upvotes: 0

Related Questions