Install Git:
https://git-scm.com/docs/git-help
Setup Config Values (Global):
git config --global user.name "Name Example"
git config --global user.email "[email protected]"
git config --list (list config values in terminal)
Help & Examples:
git help config
git add --help
Setup Own Project Local Repo: Not needed if working on remote origin
mkdir Folder
cd Folder
git init (initilize new repo)
Before First Commit:
git status
touch .testfile (creates a test file)
Save file
git status
git log (List details of all commits in local repo)
Staging Area / Changing Files:
git diff
git status
git add -A (Adds all files to staging area)
git commit -m "detailed message goes here"
git reset (only use to reset staging area i.e, added uneeded file)
Working with Remote Repo's:
git clone https://github.com/user/repo.git (clones a copy of remote repo to local)
git pull origin master (Update remote branch)
git push origin master (Push to remote)
Creating Local Branches / Checkout that Branch:
git branch (list branches)
git branch new-branch (Creates copy of master and renames)
git checkout new-branch (Goes to local created branch)
git branch
Adding / Commiting Files: Very important to be as descriptive as possible as here
git status
git add -A (Adds all files to staging area)
git commit -m "detailed message goes here"
Pushing new-branch to remote:
git push -u origin new-branch (Pushes to origin and sets up a simple git push git pull and know two branches are associated with each other)
git branch -a (see all branches, including remote)
Git Remote Add Own Upstream from new remote:
git remote add upstream https://github.com/user/name.git
Remove Upstream:
git remote remove upstream
Merge A Branch to Master:
git checkout master
git pull origin master (Important to do in case another has made changes to the master remote)
git branch --merged
git merge new-branch
git push origin master
git branch --merged
Delete the Local Branch if Needed:
git branch -d new-branch
git branch -a (check branch has been deleted)
Delete Branch from remote repo:
git push origin --delete calc-divide
Setup GPG Verified Key for GitHub:
https://help.github.com/articles/signing-commits-with-gpg/
https://help.github.com/articles/generating-a-new-gpg-key/
https://help.github.com/articles/adding-a-new-gpg-key-to-your-github-account
https://help.github.com/articles/telling-git-about-your-gpg-key/
https://help.github.com/articles/checking-for-existing-gpg-keys/
Git Documentation:
https://git-scm.com/docs/git-help
HushPup Developer / Testing: