Skip to content

Instantly share code, notes, and snippets.

@riccardoscalco
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riccardoscalco/07c25c0901ee177545c0 to your computer and use it in GitHub Desktop.
Save riccardoscalco/07c25c0901ee177545c0 to your computer and use it in GitHub Desktop.
git commands

git commands

git init #inizializza un repository

git add -A ./ #aggiunge tutti i files alla area di stage, e tiene conto delle cancellazioni
git rm 'file.txt' #rimuove il file e fa lo stage della rimozione
git rm -r ./folder
git reset file.name #rimuove un file dalla area di stage
git log
git status

git remote add origin http://github.com/.../pkg.git

git stash
git stash apply

git pull origin master
git diff HEAD #differenze con il commit più recente
git diff --staged

git branch newBranch #crea un nuovo branch
git branch #lista i branch
git checkout newBranch #passa al nuovo branch

git checkout master #passa a master
git merge newBranch #merge newBranch a master
git branch -d newBranch #cancella newBranch (se già fatto il merge)
git branch -D newBranch #cancella newBranch (anche se non fatto il merge)

Written with StackEdit.

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