Skip to content
John Rogelstad edited this page Jul 1, 2013 · 2 revisions

Create a working git directory

Fork xtuple repository

git clone [email protected]:{yourrepo}/training.git
git submodule update --init --recursive

Make a change

git status
git diff
git add .
git commit -m 'Your notes here'
git push

Do a pull request.

Merging

First time

git remote add XTUPLE [email protected]:xtuple/training.git
git fetch XTUPLE
git checkout --track -b xtuple XTUPLE/master
git checkout master
git merge xtuple
git push

Any other time

git fetch XTUPLE
git checkout xtuple
git pull
git checkout master
git merge xtuple
git push

Branching

Create your branch

git checkout -b 12345

Make your change

git add .
git commit -m 'Something new'
git push origin 12345

Do a pull request

Merging another branch

First time

git remote add {NAME} [email protected]:{name}/training.git
git fetch {NAME}
git checkout --track -b {other_branch} {NAME}/{other_branch}
git checkout {my_branch}
git merge {other_branch}
git push origin {my_branch}

Any other time

git fetch {NAME}
git checkout {other_branch}
git pull
git checkout {my_branch}
git merge {other_branch}
git push origin {my_branch}

Throw away changes in a branch

git reset --hard

Stash

Save a change

git stash

Put it back

git stash pop

Dealing with renamed or deleted files

git add .
git add -u