Reputation: 5237
I have forked a repository from github and cloned it to my local directory. I have also added a remote source to my repository by
using the command git remote set-url origin http://giturl
I checked out a branch from the remote branch and got the updated source code.
Now when I try to push my changes to my local repository using git push origin branchname
it says I do not have permission
to push to the remote repository.
Upvotes: 0
Views: 359
Reputation: 3523
To avoid confusion you could add another remote, for example:
git remote add local-repo git@host
Source: https://help.github.com/articles/adding-a-remote/
And then you can commit like this:
git push local-repo master
Upvotes: 1
Reputation: 56422
git remote set-url origin http://giturl
This command modifies the current URL the remote origin
points on. If you cloned your repository from github, it was already good and you didn't need to modify it.
You may want to change the remote URL by issuying the same command, replacing the http://giturl
by what you've put behind git clone
.
Upvotes: 0