Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can one dry run a git push to check whether one has write permissions to a remote?

Is there a way to dry run a git push to know whether the user has permissions to actually create a new remote branch? I'd like to be able to verify that all is good in regards to permissions for a bunch of repos where the user will attempt to create new branches before they are actually created so that I can dry run the full execution before actually doing it.

like image 520
David Avatar asked Aug 20 '14 11:08

David


People also ask

How do I check permissions in git?

Open Security for a repository You set Git repository permissions from Project Settings>Repositories. Open the web portal and choose the project where you want to add users or groups. To choose another project, see Switch project, repository, team. Open Project settings>Repositories.

What does git push dry run do?

Dry Run Option in Git Push This option will perform and show the execution of the git push command but will not send any updated to the remote repository.


1 Answers

Shawn Pierce wrote the following about git push --dry-run:

A --dry-run doesn't send the commands the client would use from client to server, so the server can't tell the client if it would accept them or not. The entire --dry-run thing is client side only.

(my emphasis)

So, if there is a way to check whether one has write permissions to a remote, git push --dry-run is definitely not it.

like image 69
jub0bs Avatar answered Sep 20 '22 09:09

jub0bs