Last active
February 21, 2018 03:29
-
-
Save eramella/cf115b53543df58fdc9be30e9b6ca7d2 to your computer and use it in GitHub Desktop.
As a reminder and to learn Git
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
1) git branch -d <branch_name> | |
2) git checkout -b <branch name> | |
3) git show-branch | |
4) git add --all | |
5) git push -u origin <branchName> | |
6) git fetch origin | |
7) git push origin --delete <branch name> | |
8) Add remote Github repo to local exisitng: | |
git remote add origin <remote repository URL> | |
# Sets the new remote | |
git remote -v | |
# Verifies the new remote URL | |
git push origin master | |
# Pushes the changes in your local repository up to the remote repository you specified as the origin | |
9) git push --set-upstream origin <branch name> or better: git branch -u origin/<branch name> | |
10) Undo a commit and redo: | |
$ git commit -m "Something terribly misguided" (1) | |
$ git reset HEAD~ (2) | |
<< edit files as necessary >> (3) | |
$ git add ... (4) | |
$ git commit -c ORIG_HEAD (5) | |
11) git rm -r --cached .vs/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Git Commands