Git commands I frequently use but never remember…

  • Delete a remote git branch but keep it locally:

git push origin :branchname

  • Delete a local git branch but keep it remotely:

git branch -d branchname

  • Rename a local branch:

git branch -m

  • Rename current branch

git branch -m

  • Delete the previous remote commit and revert to the second to last one

git reset –hard

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: