Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  1. Get the repository:
    Code Block
    git clone git@github.com:fcrepo/fcrepo.git
    cd fcrepo
    or
    Code Block
    git clone http://github.com/fcrepo/fcrepo.git
    cd fcrepo
  2. Create the branch where you'll do your work:
    Code Block
    git branch fcrepo-780
    git checkout fcrepo-780

    The checkout command makes whatever branch you specify the local active branch. Make your changes, test...

  3. Add your edited/new files, then commit your branch:
    Code Block
    git add myfile.java
    git commit myfile.java
  4. If you're working on a branch for some time, you may want to update your branch with the latest changes to master.

  5. Push the branch back up to github
    Code Block
    git push origin fcrepo-780
  6. Merge the branch into Check out master (formerly known as 'trunk'):
    Code Block
    git checkout master
    Make sure it's current.

  7. Merge the branch into master (formerly known as 'trunk')
    Code Block
    
    git merge fcrepo-780
    Resolve any conflicts, and test again.
    If any time has passed since you cloned master from github and merged your branch into your local copy of master, make sure that you also merge any upstream changes to master into your local copy:
    Code Block
    git fetch origin master
    Examine the changes:
    Code Block
    git diff origin master
    then:
    Code Block
    git merge origin/master
    (The command git pull does a combined fetch-and-merge, but read this on why that's a bad idea.)
    Merges are automatically committed locally.

  8. Update master on github:
    Code Block
    git push origin master
  9. Once you've received word that the build has completed correctly, delete the branch
    Code Block
    git push origin :fcrepo-780

...

  1. Get the repository:
    Code Block
    git clone git@github.com:fcrepo/fcrepo.git
    cd fcrepo
  2. Create the branch where you'll do your work:
    Code Block
    git branch fcrepo-780
    git checkout fcrepo-780

    The checkout command makes whatever branch you specify the local active branch. Make your changes, test...

  3. Add your edited/new files, then commit your branch:
    Code Block
    git add myfile.java
    git commit myfile.java
  4. Graft your changes (and commit histories) onto the end of master:
    Code Block
    git rebase master
    
    You may need resolve conflicts, then re-add and re-commit the merged files. If this is the case, you can pick up where you left off with the command git rebase --continue.
    The command git rebase -i master allows you to interactively edit, suppress, combine the commits in your branch, to eliminate non-useful or trivial commit messages in the final result.

  5. Switch to the master branch, update it to the latest version:
    Code Block
    git checkout master
    git pull
    
  6. Merge in the changes from your unpublished, rebased branch:
    Code Block
    git merge fcrepo-780
    

    Merges are automatically committed locally.

  7. Update master on github:
    Code Block
    git push origin master

Anchor
mergeupstream
mergeupstream

Examining and merging in upstream changes

If any time has passed since you began working on your local branch, make sure that you also merge any upstream changes to master into your local copy before pushing your changes back up:

Code Block
git fetch origin master

Examine the changes:

Code Block
git diff origin master

then:

Code Block
git merge origin/master


If there were no conflicts, the merge will be automatically committed. If there are conflicts you will need to resolve them and then commit.
(The command git pull is a shortcut for doing a combined fetch-and-merge, but read this on why that's a bad idea.)