Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Command

Description

git reset <file>

Un-stage a file

Remove a file from add list

git checkout <file>Revert changes to a file
git reset --hardReset all of your changes to your local branch.

git reset HEAD~1

Revert the commit.

git clean -fRemove files not under version control.
git checkout HEAD <file>Replace file from HEAD. Use to undelete and reset a deleted file.

git config --get remote.origin.url

Get URL of current Git repository.

git remote show origin

Show Git repository information

git reset --hard <GITREF>

git push -f

Revert the current branch to the specified gitref. (Rewinding). The push forced may be required to push this to origin.

DO NOT DO THIS!

git fetch origin

git rebase -i origin/develop

> delete commits that are not yours

write and exit


Fixup branch

...

Command

Description

git stash

git stash save <stash_name>

Stash your changes for later

git stash pop [ DON'T USE, USE APPLY ]Apply your stashed changes and remove from stash.
git stash listList all stashes
git stash apply <stash>Apply specific stashed changes to your local.
git stash branch <branch name>Create a branch from the stash


Tagging

Command

Description

git tag <tag>


Create tag

ex: git tag v0.2.0

git push origin --tags

Push tag to origin

Git Documentation

See Git Reference for more info.

...