Skip to content
keithwoodlock edited this page Aug 1, 2012 · 7 revisions

Git common tasks

Create a local branch

create branch [new branch name]

Push local branch up to remote repository

git push origin [branch name]

Delete local branch

git branch -D [branch name]

Delete remote branch

git push origin :[branch name] OR git push origin --delete [branch name]

If the remote branch also has a tag of the same name and you get an error try git push origin :refs/heads/[branch name]

Prune local repository of all 'delete branches'

git remote prune origin

List tags

git tag

Create a tag

git tag -a mifos-il-beta-? -m "Mifos Individual Lending: version beta-?"

Push tags to remote repository

git push --tags

Handling Pull Requests

see https://help.github.com/articles/using-pull-requests

in keithwoodlock/mifosx:

git checkout master # Check out your master branch

git remote add [forkusername] git://github.com/[forkrepository]/mifosx.git # Add a new remote named after forks maintainer

git fetch [remotename] # Pull in all the commits from the remote

git merge [remote]/[branch] # Merge your master branch into the branch from the remote

Optional: Might want to create a local branch with the 'pull request changes':

git checkout -b [new branch name]

git push origin master # Push your newly-merged branch back to GitHub