Skip to content

Instantly share code, notes, and snippets.

@ruben-rodriguez
Last active April 25, 2017 16:07
Show Gist options
  • Save ruben-rodriguez/b81c48bbdd31a7ac2e4b9afcf9ffa576 to your computer and use it in GitHub Desktop.
Save ruben-rodriguez/b81c48bbdd31a7ac2e4b9afcf9ffa576 to your computer and use it in GitHub Desktop.
GIT CMD
CONFIGURING:
$ git config --global user.name “NAME”
$ git config --global user.email “email@email.com”
CLONING:
$ git clone https://github.com/ermus19/meteo.git
UPDATING:
$ git pull
SCRIPTS EXEC PERMISSIONS:
$ git update-index --chmod=+x <SCRIPT_NAME>
BRANCHING:
$ git checkout -b <NEW_BRANCH_NAME>
CHANGE TO BRANCH:
$ git checkout <BRANCH_NAME>
MERGE & REBASE:
$ git merge
$ git rebase
PUSHING:
$ git add .
$ git commit -m “COMMIT MESSAGE”
$ git push origin <BRANCH_NAME>
Changing remote:
$ git remote rm origin (or name)
$ git remote add <name> <url>
Delete last pushed commit to remote:
$ git push -f origin HEAD^:master
Edit commit without pushing:
$ git commit --amend -m "NEW COMMIT MESSAGE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment