Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm new to the social coding community and don't know how to proceed properly in this situation:

I've created a GitHub Repository a couple weeks ago. Someone forked the project and has made some small changes that have been on my to-do. I'm thrilled someone forked my project and took the time to add to it. I'd like to pull the changes into my own code, but have a couple of concerns.

1) I don't know how to pull in the changes via git from a forked repo. My understanding is that there is an easy way to merge the changes via a pull request, but it appears as though the forker has to issue that request?

2) Is it acceptable to pull in changes without a pull request? This relates to the first one. I'd put the code aside for a couple of weeks and come back to find that what I was going to work on next was done by someone else, and don't want to just copy their code without giving them credit in some way. Shouldn't there be a to pull the changes in even if they don't explicitly ask you to? What's the etiquette here

I may be over thinking this, but thanks for your input in advance. I'm pretty new to the hacker community, but I want to do what I can to contribute!

share|improve this question
    
Here's a great resource for working with remotes (and anything else related to Git): http://git-scm.com/book/en/Git-Basics-Working-with-Remotes –  Nick C. Nov 2 '13 at 12:46

1 Answer 1

up vote 19 down vote accepted

1) To pull in somebody else's changes, first add a remote that points to their repository. For example:

git remote add soniakeys https://github.com/soniakeys/goptimize.git

Then, you can fetch those changes into your repository (this doesn't change your code, yet):

git fetch soniakeys

Finally, to merge those changes, make sure you're on your master branch and:

git merge soniakeys/master

2) To be polite, you would normally ask the author whether it's okay to pull the changes. Just because they're on a public repository doesn't necessarily mean they are ready to pull. There might be further work to do, or perhaps intellectual property issues, or whatever. However, with published changes on an open source repository, asking is not strictly required.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.