Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Workflow for managing pull requests on shared repos in github

I'm trying to manage a pull request on a repo that I don't own but have admin rights on. When I attempt to pull in changes from another fork, it fails with an error that is less than clear. Here is my workflow...

  1. Fork main repo
  2. Make changes in that fork
  3. Commit to that fork
    3.5 (goto step 2)
  4. Submit a pull request to the main repo

As an administrator of the main repo, I'm attempting to merge those changes as follows...

  1. git clone [email protected]:dude/project.git
  2. git checkout -b gtracy-master master
  3. git pull http://[email protected]/gtracy/project.git master

After entering my password, I get the error message...

error: The requested URL returned error: 401 while accessing 
http://[email protected]/gtracy/project.git/ifno/refs

Is this workflow wrong? Is there an easier way to manage my own pull requests?

Thanks!

like image 950
Greg Avatar asked Dec 17 '10 22:12

Greg


1 Answers

The GitHub "pull request" help page don't mention it, but I prefer rebasing my work done in a fork on top of the branch from the original repo before submitting any pull request.
That is, I would add the original repo as a remote, fetch the branch to which my pull request will eventually apply, and rebase first my work locally (within my fork) on top of that branch.
That way I make sure all my pull requests will be fast-forwards one.

In your case though, that may not apply if you know that no changes has been published in the original repo since you have forked and worked on your local repo.

For your second part, I would follow the "Merging pull request" part, and add your forked repo as a remote of your original repo clone.

That being said, error 401 "Unauthorized" is mentioned in the GitHub Smart HTTP page:

Don't forget the https part - Git will send your password hashed but unencrypted over the wire, so be sure to use SSL.
In future versions of Git (assuming our patch gets integrated), Git will prompt you for your username if it's not provided and the client gets a 401, so you won't actually have to put your username in the URL - it will just ask you when Git needs it.

So if you want to use the username in your address, try with https.
Or try with http://github.com/gtracy/project.git (public repo address)

like image 59
VonC Avatar answered Nov 15 '22 03:11

VonC