Git commands

git init (choose folder to initialise)

git status (checks whats added)

git add . (adds all files in the folder and subfolders)

git commit -m “added a random file“

git commit -a -m “added more info” (commit all changes and adds a comment)

Working in different branches:
git branch addfonts (creates a branch with the name addfonts)

git checkout addfonts (changes from Master branch to addfonts)

git checkout master (go back to Master branch)

git branch (lists all the branches and show where you are)

git branch -d addfonts (removes the addfronts branch)

git merge addfonts (adds all changes from addfonts branch to the branch you are in, most likely Master branch when merging)

———————————————

git remote add origin https://github.com/user/xxxx.git
git push -u origin master

git diff (check the differences if you have changed a file)

Leave a Reply

Your email address will not be published. Required fields are marked *