Yama Noorstani
Yama Noorstani

Reputation: 11

Issues with Git

How can I unhook a current repository from where it's currently pointing within git?

I am trying to complete the following for Bloc:

Add Bloc Jams in between the tags. Commit your changes and push them to github.

$ git add . 
$ git commit -m "added title to bloc jams" 
$ git push

When I applied these changes it came up with the following:

remote: Permission to Bloc/bloc-jams-student-skeleton.git denied to ynoorstani. 
fatal: unable to access 'https://github.com/Bloc/bloc-jams-student-skeleton.git/': The requested URL returned error: 403

I am quite new to Git so any helpful tips would be awesome thanks!

Upvotes: 0

Views: 60

Answers (3)

zmo
zmo

Reputation: 24812

The reason why you cannot send your changes is that you do not have the rights to do so. I'm not sure you can actually push changes using the http URL of a project, as I always use the SSH one. (The 403 error means that you have insufficient permissions to do what you ask)

So if the project's not yours: on Github you need to have an account (if it's not already the case), then click on the "fork" icon on the project's page you want to send a change to.

Then, if you do not already have setup a key github for your account, you need to create on, and upload it on github.

From your forked project's page, you got to copy the SSH url of your project, and run a command such as:

git remote add mygithub git@yoururl:youraccount/bloc-jams-student-skeleton.git

you can send your changes to your repository, using:

git push mygithub master

And finally, to send the pushes to the upstream project, you need to create a Pull Request, by going on the original project's page, where such an icon will appear once github will have noticed that your fork has more commits than the upstream project.

Upvotes: 0

Vitalii Elenhaupt
Vitalii Elenhaupt

Reputation: 7326

You don't have permissions to push changes to that repository. Refer to github documentation to do the job.

Upvotes: 0

Madara's Ghost
Madara's Ghost

Reputation: 174937

You can't push to a repository you don't own or have access to. You need to first fork the target repo, so that there's a copy of it that sits under your username, then you can push to that.

As for how to manage your remote repositories, have a look at git remote --help.

Upvotes: 1

Related Questions