Common git instructions i use in my day to day
first create .gitignore in the folder
git init
git add *
git commit -m "initial commit"
then create empty repository in <GitHub web>
<remote> is commonly named as origin
git remote add <remote> <github web>
git push --set-upstream <remote> main
git fetch
git pull
stage all changes in <directory>/<file>
git add <directory>/<file>/<regularexp>
commit staging
git commit -a
commit with <message> instead opening text editor
git commit -m <message>
display entire commit history
git log
Annotated tag to a commit already done
git tag -a v1.4 -m "my version 1.4"
git tag v1.4
Show tags
git tag
Show tag version
git show v1.4
Do push after tagging
git push --tag
Delete local tagname
git tag -d tagname
Delete remote tagname
git push --delete origin tagname
create local <branch>
git checkout -b <branch>
list all branches
git branch
push the <branch> to <remote>
git push <remote> <branch>
track the <branch>
git push --set-upstream <remote> <branch>
fetch and merge the remote branch into the local
git fetch
git pull
change current <branch>
git checkout <branch>
merge <branch> in the current
git merge <branch>
delete <branch> locally and remote
git branch -d <branch>
git push <remote> --delete <branch>
locate in the root folder, it will create a new folder
git clone https://github.com/goojoob/testing