_________ .__ .__ _______ __ __
/ _____/ ____ ____ |__|____ | | \ \ _____/ |___ _ _____________| | __
\_____ \ / _ \_/ ___\| \__ \ | | / | \_/ __ \ __\ \/ \/ / _ \_ __ \ |/ /
/ ( <_> ) \___| |/ __ \| |__ / | \ ___/| | \ ( <_> ) | \/ <
/_______ /\____/ \___ >__(____ /____/ \____|__ /\___ >__| \/\_/ \____/|__| |__|_ \
\/ \/ \/ \/ \/ \/
[some_text]
: this is to be replaced as whole with some other text that makes
sense and doesn't include space in it.
git branch
git branch | grep \*
Explanation: the git branch
list all existing branch we want to find the
branch that is marked with *
, the grep \*
normally takes multi-line text as
input and output only the lines that contains a *
, the |
means redirect the
output of git branch
to stdin of grep \*
git checkout -b [BRANCH_NAME]
git branch -D [BRANCH_NAME]
git push origin [BRANCH_NAME]
Note: please not that [BRANCH_NAME]
doesn't necessarily have to be the same
name as current working branch, still it is a good convention to follow.
git status
git diff
git add [FILE_OR_FOLDER_RELATIVE_PATH]
git pull origin [BRANCH_NAME_ON_GITHUB]