0

I'm not familiar with Git, I only know how to download a master or dev branch of a python software project from Github and install into my system (I do not really use Git locally).
Now there is a "pull request" by a GitHub user which contains a feature I find useful but not in the main or dev branch. How can I use that in my local copy?
And if I manage to include it into my local copy, would it be lost if I later updated to the latest maaster/dev branch?

ng0323
  • 297
  • 1
  • 5
  • 13
  • The pull request itself is not relevant, what you want is the branch they have made changes on. The PR is just a request to merge that branch into master. – Daniel Roseman Jan 09 '15 at 08:27

3 Answers3

0

see: Git fetch remote branch

git fetch

git checkout  <the name of the remote branch>
Community
  • 1
  • 1
Urban48
  • 1,278
  • 12
  • 25
0

You can revert to any commit anytime you want, those changes are kept in the repository so you can visit different versions of it during the development on all branches. You need to do a merge command, which if, there's not any conflict with the patch contained in the pull request, will combine the code of the patch with the code of the repository. If there's conflicting code, like shared files for example, you will have to do the proper refactors and select which changes get inside or not.

Here you have basic information about merging different branches:

http://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging

0

Updating will only do a merge with the changes and your master. If you break something you can stash the changes and get to the original state. Also I would suggest to checkout a fresh branch and apply that feature on the freshly created branch. If every thing works fine merge it to your master otherwise delete and forget it :P

if you dont know the branch name use git fetch first to know the branch name and then git checkout

Also maybe you can find this link useful

shikjohari
  • 2,147
  • 8
  • 23
  • So you are saying that a PR, which has not been merged at the repository's master branch (I am not the repository owner), can be merged in my local copy (master or otherwise) ? – ng0323 Jan 29 '15 at 01:53