These are notes that were removed from the documentation. It's important information, but maybe too much detail for the docs.
After your pull request is accepted OR it's been a while since you've updated your fork Once you've set up your fork, you'll need to update it regularly to make sure you have all the current files. There is unfortunately no way to do this with the GitHub Desktop tool, but it's not too complicated to update it.
-
Open GitHub Desktop
-
Click on your fork to open it.
-
Right click on the name of the fork and select "Open Command Prompt" or "Open in Git Shell" (depending on the version you have the text will be different). A command line shell will open. The path before the > should be where you store your data (probably the GitHub folder on your computer).
-
You will now run a few commands to update your fork (reference).
- The first time you'll need to set an upstream repository for your fork:
git remote add upstream git://github.com/UCDavisLibrary/ava.git
- Now you'll fetch any changes:
git fetch upstream
- Finally, you'll update your folder with the changes you just fetched:
git pull upstream master
When things go wrong In the event that your fork gets too messy (such as you have too many differences in your fork and you can't sort it out), you can do a hard reset to remove everything from your fork and replace it with what is on the UC Davis AVA repository.
-
Copy any data you've been working on into a folder not affected by git.
-
Run a few lines of code to reset your repository:
- The first time you'll need to set an upstream repository for your fork:
git remote add upstream git://github.com/UCDavisLibrary/ava.git
- Now the reset:
git fetch upstream git checkout master git reset --hard upstream/master git push origin master --force
-
Finally, move any data you've been working on back into it's folder. Now you can do a pull request like you normally would.
If a pull request cannot be merged automatically by GitHub, you can remove or modify files before you merge them into the main repository.
Step 1: In the command line tool, from your project repository, check out a new branch and test the changes.
git checkout -b [repository user name]-master master
git pull https://github.com/gdmf/ava.git master
Step 2: Remove or modify files on your computer.
Step 3: Commit the changes.
Step 4: Merge the changes and update on GitHub.
git checkout master
git merge --no-ff [repository user name]-master
git push origin master
Another Option: If you want to accept only some of the changes offered in a pull request, you will need to use the command line to cherry-pick the commits that you want to keep.