/
04 - Git

04 - Git

Managing your personal access tokens - GitHub Docs

Bash file manipulation cheat sheet

cd - change directory

cd .. - change to parent directory

pwd - print working directory

mkdir - make directory

rmdir - remove empty directory

rm - remove a file

rm -r - removes non-empty directory

ls - list content of directory

ls -a - lists also hidden files

clear - clear the shell

 

Git cheat sheet

git init - initialise git repo in a folder on your laptop

git add . - adds all files to be staged for commit

git restore <filename>- remove from staged

git rm --cache <filename> - same as above

git checkout <filename> - undo un-staged changes

git commit -m "" - commit your changes with a message

git log - history of commits

 

For remote:

git clone URL - clone remote repo onto your laptop

git push - push your changes to remote repo

 

Setup

Git - Downloads

For Mac:

Install brew by running this command in your Terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install Git using brew:

brew install git