Last active
May 27, 2016 18:31
-
-
Save SimoPrG/9b42b3588eafca90b052bea7418689bf to your computer and use it in GitHub Desktop.
git commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Discard all changes in the working directory | |
git checkout * | |
//Add all changes to the commit | |
git add -A | |
//Add all changes in the tracked files and commit | |
git commit -am "Commit message" | |
// List branches | |
git branch //(or 'git branch --list') list all local branches | |
git branch -r //(or 'git branch --list -r') list all remote branches | |
git branch -a //(or 'git branch --list -a') list all branches | |
// create new branch and select it | |
git checkout -b "BranchName" | |
// push local branch and set it to track the remote one | |
git push [-u | --set-upstream] origin local-branch-name | |
// Stop tracking remote branch and delete it locally | |
git branch --unset-upstream <branchname> // Removes the upstream information for the current branch | |
git branch -d -r origin/<branchname> // Delete remote tracking branch | |
git checkout master // Select master branch | |
git branch -d <branchname> // Delete local branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment