Reputation: 2090
I have a github repository with a username - let's call it githubuser
I have a workstation again with a username - let's call it workstationuser
I cloned the repo on my machine and changed something. Now I want to push the changes to github, so that githubuser
is the author.
But when I execute git push origin master
I always get
remote: Permission to githubuser/your-repo.git denied to emersoncod.
I have no idea how and when this user emersoncod
was set, I simply cannot get rid of that.
Where could this be configured ? How can I configure it that githubuser
is pushing ?
Thanks for any help
I checked the .git/config
file inside my local checkout
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://github.com/githubuser/your-repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[user]
name = githubuser
email = [email protected]
And the .gitconfig
file in my home directory
[user]
name = githubuser
email = [email protected]
Upvotes: 1
Views: 229
Reputation: 2090
Ok I found it out myself.
I changed the git/config
file to
url = [email protected]:githubuser/your-repo.git
so from https
to ssh
and with that it works.
Upvotes: 1
Reputation: 141946
It can be one of several reasons:
Settings
link in the right side menu, below Network
Collaborators
menu item on the left side of the page.Add
button.Read this out: http://readwrite.com/2013/10/02/github-for-beginners-part-2
ssh
You have to define new keys for the user
Simply follow those steps and you will set up your ssh key in no time:
Generate a new ssh key (or skip this step if you already have a key)
ssh-keygen -t rsa -C "your@email"
Once you have your key set in home/.ssh
directory (or Users/<your user>.ssh
under windows), open it and copy the content
SSH keys
Add ssh key
And you all set to go :-)
Upvotes: 3
Reputation: 2066
From your repository within GitHub, navigate to the settings screen from the list menu on the right side of the browser. From the settings go to the collaborators section using the link on the left side of the screen. Add your local username (workstationuser) to the list of collaborators and you will be able to push to the repo.
You can use the method mentioned by @Tgsmith61591 to set your username in local repository.
Upvotes: 0