Skip to content

Latest commit

 

History

History
64 lines (49 loc) · 2.99 KB

Notes.md

File metadata and controls

64 lines (49 loc) · 2.99 KB

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.

  1. Open GitHub Desktop

  2. Click on your fork to open it.

  3. 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).

  4. You will now run a few commands to update your fork (reference).

    1. The first time you'll need to set an upstream repository for your fork:
        git remote add upstream git://github.com/UCDavisLibrary/ava.git
    
    1. Now you'll fetch any changes:
        git fetch upstream
    
    1. 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.

  1. Copy any data you've been working on into a folder not affected by git.

  2. Run a few lines of code to reset your repository:

    1. The first time you'll need to set an upstream repository for your fork:
        git remote add upstream git://github.com/UCDavisLibrary/ava.git
    
    1. Now the reset:
    git fetch upstream
    git checkout master
    git reset --hard upstream/master  
    git push origin master --force
    
  3. 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.

Notes for pull request reviewers:

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.