Error while pushing

84 views
Skip to first unread message

Ashwini T R

unread,
Jan 10, 2017, 5:16:03 AM1/10/17
to Repo and Gerrit Discussion

When trying to push we get the following error:

 

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin treeinterpreter_for_git:treeinterpreter_for_git
POST git-receive-pack (628 bytes)
remote: Branch refs/heads/treeinterpreter_for_git:        
remote: You are not allowed to perform this operation.        
remote: To push into this reference you need 'Push' rights.        
remote: User:
user1       
remote: Please read the documentation and contact an administrator        
remote: if you feel the configuration is incorrect        
remote:

remote: Processing changes: refs: 1
remote: Processing changes: refs: 1, done            
Pushing to
https://user@<server>/a/<project_name>
To 
https://<server>/a/<project_name>
= [up to date]      v0.0_stable -> v0.0_stable
! [remote rejected] treeinterpreter_for_git -> treeinterpreter_for_git (prohibited by Gerrit)

error: failed to push some refs to '
https://user@<server>/a/<project_name>
Completed with errors, see above.


We’ve checked and user “user1” (which is indeed a user created by us) is not provided somewhere in the settings , i.e.  `git config --global user.name` gives “user2”.

We have no idea how it shows up there and why git tries to push with this user1.

 

Can you please help? 


thanks

Ashwini

Saša Živkov

unread,
Jan 10, 2017, 5:21:14 AM1/10/17
to Ashwini T R, Repo and Gerrit Discussion
Your assumption that the user.name setting is used as the current user when pushing to a remote Git is incorrect.
 

We have no idea how it shows up there and why git tries to push with this user1.


How is the "origin" defined in that local repo?
 

 

Can you please help? 


thanks

Ashwini

--
--
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ashwini T R

unread,
Jan 10, 2017, 5:47:43 AM1/10/17
to Repo and Gerrit Discussion, ashu.r...@gmail.com
Hi,

When we are trying to push the repository using "User2", why does gerrit trying to push using "User1" ????
And the user.name setting is shared as to show for reference we have configured that with "User2" still the push operation is trying with "User1" :(:(

And we have required rights defined in the project for "User2". And we want the push operation should happen via "User2" not user1.

Could you suggest what went wrong here

git config --global user.name` gives “user2


Regards
Ashwini

--
--
To unsubscribe, email repo-discuss...@googlegroups.com

More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Saša Živkov

unread,
Jan 10, 2017, 6:25:30 AM1/10/17
to Ashwini T R, Repo and Gerrit Discussion
On Tue, Jan 10, 2017 at 11:47 AM, Ashwini T R <ashu.r...@gmail.com> wrote:
Hi,

When we are trying to push the repository using "User2", why does gerrit trying to push using "User1" ????

This is why I asked you about how the "origin" is defined in your local Git repo.
 
And the user.name setting is shared as to show for reference we have configured that with "User2" still the push operation is trying with "User1" :(:(
Sorry, but this is a wrong assumption from your side.
The user.name setting is NOT used when authenticating a push request.
 

--
--
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com

More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.

David Pursehouse

unread,
Jan 10, 2017, 7:33:40 AM1/10/17
to Ashwini T R, Repo and Gerrit Discussion
On Tue, Jan 10, 2017 at 7:47 PM Ashwini T R <ashu.r...@gmail.com> wrote:
Hi,

When we are trying to push the repository using "User2", why does gerrit trying to push using "User1" ????
And the user.name setting is shared as to show for reference we have configured that with "User2" still the push operation is trying with "User1" :(:(


The user.name setting in the .gitconfig only sets the name that is used as the commit author.  It is not the username for push authentication.

The username used to push could be set in the remote, which you can see by doing `git remote -v`.  Alternatively it could be set in the user's ~/.netrc entry for the servername.

Ashwini T R

unread,
Jan 11, 2017, 1:47:35 AM1/11/17
to Repo and Gerrit Discussion, ashu.r...@gmail.com
Hi,

Thanks for the reply, We checked the origin details by using below command, But the user who is pushing is correct that is "USER 2"

 $ git remote -v

origin  https://USER2@<host_name>/a/<project_name> (fetch)

origin  https://USER2@<host_name>/a/<project_name> (push)



But the error we are receiving is from USER 1

Please suggest how to proceed.



Regards

Ashwini



Ashwini T R

unread,
Jan 24, 2017, 2:44:21 AM1/24/17
to Repo and Gerrit Discussion, ashu.r...@gmail.com
Hi,

Thanks for providing the suggestions. The issue is resolved now .!!

Regards
Ashwini
Reply all
Reply to author
Forward
0 new messages