Skip to content

Instantly share code, notes, and snippets.

@bradjenn
Last active August 29, 2015 14:13
Show Gist options
  • Save bradjenn/9c5a1437265014d5a336 to your computer and use it in GitHub Desktop.
Save bradjenn/9c5a1437265014d5a336 to your computer and use it in GitHub Desktop.
My Git Process

GIT PROCESS

Fetching

git fetch

this will update all your local versions of the remote branches

git checkout [branch-name]

to change to the branch you want to be on

Updating your local branches

If you have no new commits and want to make the branch up to date with the remote

Warning! this will overwrite all changes/un-synced commits you have

git reset --hard origin/[branch-name]

If you have new commits and need to rebase

git rebase origin/[branch-you-want-to-rebase-with]

Pushing

To push your changes to the remote

git push origin [branch-name]

If you have rebased your branch and the history is now different to the remote you will need to force-push

git push origin [branch-name] -f

Committing

after staging your changes to commit you will need to commit

commit with a description

git commit (this will bring up your editor vim/sublime/...)

one line commit

git commit -m "your commit message"

@yggie
Copy link

yggie commented Jan 19, 2015

could be useful to have the command to change the editor, i.e.:

git config --global core.editor vim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment