Create an initial git repo: got to the root folder and run the command:
sh
git init
Add all existing files in the folder:
sh
git add --all
Commit your changes with a message:
sh
git commit -am ‘First commit’
Check the files and folders to be committed:
sh
git status
Check the difference of a working file from last version:
sh
git diff [file path]
Check the existing commits starting from the last one:
sh
git log
Checkout an existing branch:
sh
git checkout master
Show branches:
sh
git branch
Create new local branch stripy
:
sh
git checkout -b stripy
Create new remote branch to origin
called stripy
:
sh
git push --set-upstream origin stripy
Show all remote branches:
sh
git branch -va
Checkout a remote branch to a new local branch:
sh
git checkout -b stripy remote-name/stripy
Delete local branch stripy
:
sh
git branch -d stripy
Delete remote branch stripy
:
sh
git push origin :stripy
Clone remote branch:
sh
git clone git@github.com:lugolabs/circles.git