gh0st
gh0st

Reputation: 1722

Pushing changes or creating pull request on a repo I lack access to

I goofed and wanted to help contribute to a repo I lack access to or don't own but I think what I did was in the wrong order. Here is what I did.

  1. I went to the repo on GitHub and cloned the project.
  2. I did all my work on the repo.
  3. I made my commit and tried to push but of course I get remote: Permission to Codenator81/ng2do-mean-app.git denied to me.

So I'm guessing now I'll need to fork the original project? Change my remotes in my local project, and then push my changes to my forked project? Am I right about that?

Once I have those changes up to my forked project, I can then make a pull request to the original project. Yes?

Or is all this really necessary? All I want to do is contribute my changes to the original repo.

Upvotes: 0

Views: 25

Answers (1)

Scott Weldon
Scott Weldon

Reputation: 10227

Yes, without push access, your only option is to fork the repo.

It doesn't matter whether you clone from the original and then fork, or fork and then clone from your fork. In either case, you'll have to add the other repo as a remote. E.g.:

git remote add upstream https://github.com/Codenator81/ng2do-mean-app.git

(I usually fork and clone from the fork, so that origin points to my fork, and I can add upstream as the original repo. Of course, you can still do it the other way and rename the remote with git remote rename.)

If your changes are simple enough, then GitHub does allow you to edit files directly in the web interface. However, this is just a shortcut for the fork-and-clone process that you are doing (except that you don't have to clone the repo to your machine).

Upvotes: 1

Related Questions