Project

General

Profile

WorkingWithGitHub

Note: This is a DRAFT it needs user testing

Many people keep asking how to work with Redmine repositories and GitHUB effectively.

Putting a copy of your Redmine repository on GitHUB.

  1. create an empty repository on GitHUB
  2. get a working copy
    git clone ssh://p-project@cdcvs.fnal.gov/cvs/projects/project 
    cd project
    
  3. add your github repository as a remote
    git remote add mygit git@github.com:username/repo.git
    
  4. push a copy up there
    git push -all mygit
    

Updating your GitHUB repo

If you keep around the working copy, above, you can:

git pull origin
git push mygit

from inside it. Otherwise, just redo the 4 steps from the previous section.

Handling a pull request

Get a working directory again.
  1. get a working copy
    git clone ssh://p-project@cdcvs.fnal.gov/cvs/projects/project 
    cd project
    
  2. add your github repository as a remote
    git remote add mygit git@github.com:username/repo.git
    
  3. pull down the pull request as a local branch, and merge it
    git fetch mygit pull/pull-id/head:newbranch
    git merge newbranch
    
  4. or, work on it first...
    git fetch mygit pull/pull-id/head:newbranch
    git checkout newbranch
    # fix stuff...
    git rebase master
    # fix stuff
    git checkout master
    git merge newbranch
    git push origin
    git push mygit