git init
on local folder- Create new empty repository on remote without any files
git remote add origin [email protected]:arvindgs/kinesisdemo.git
git branch --set-upstream-to=origin/master master
git add .
git commit -m "Initial commit"
git push
Last active
May 3, 2021 05:52
-
-
Save arvindkgs/20e16e031b9f07ece883279aa65ced37 to your computer and use it in GitHub Desktop.
[Git] Git commands #cheatsheet #cli #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
# Switch to branch | |
git checkout branch | |
# Create new branch and move changes to new branch | |
git switch -c new-branch | |
# Merge into current | |
git merge branch | |
# branch current | |
git branch branch | |
# branch new from other and switch to it | |
git checkout -b new other |
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
# Reset all changes added to staging | |
git reset HEAD -- . | |
# Undo stage | |
git restore --staged <files> | |
# reset to last commit | |
git reset | |
# options | |
--hard (NO UNDO) | |
# Replace prev commit | |
git commit -a --amend |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment