Git Repo
Init a Repo
git init
git add .
git commit -m "blablabla"
git remote add origin <https://github.com/yoho/someurl.git>
git push -u origin master
Clone existing repo
git clone <https://github.com/yoho/someurl.git>
# make edit
git push origin main
Miscellaneous
git config
~/.gitconfig
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg3 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
git ignore file
- In order to remove existing files from the repo
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
- Add line to your .gitignore file
echo .DS_Store >> .gitignore
- Finally
git add .gitignore
git commit -m 'DONEEEEEE'