How to…

Setting up

Get a repo from origin git clone <REPO URL>

Add remote origin

git remote add origin https://<repo>.git git push -u origin master

Checking out latest changes

git fetch
git checkout origin/master

References:

Force-overwrite local files

Committing

View/add partial bits to the commit with a prompt yes/no git add -p

verbose commit, look at changes.Recommended git commit -v

git log git log --oneline --graph --decorate

git clean -fd # remove untracked

Cleaning

Remove untracked files (FORCE) git clean -f

Destroy local changes, but choose from patch git checkout -p

Git Ignore

Issues

Large files detected. You may want to try Git Large File Storage.

https://medium.com/@marcosantonocito/fixing-the-gh001-large-files-detected-you-may-want-to-try-git-large-file-storage-43336b983272

Advanced

Branching

Create and switch to a new branch

git checkout -b 'mybranch'

Shorthand for

git branch mybranch
git checkout mybranch
git checkout master
git merge mybranch

Delete branch

git branch -d mybranch

Related pages