Class 20 - Git/GitHub
here to deal with paths.sessionInfo()Initialize an empty Git repo
git init
Download a repository from GitHub to local freshly
git clone repo_url
Pull changes from remote to local on the same branch
git pull
Upload changes to remote
git push or git push origin branch_name
Check current branch
git branch
Create new branch
git branch new_branch_name
Switch branch
git checkout branch_name
Check the current state of the repo since last commit
git status
Stage and commit changes
git add . # stage all changes
git add file_path # stage a specific file
git commit -m 'Commit message' # commit the staged changesShortcut of doing both together
git commit -am "Commit message"
Unstage a staged file
git checkout file_name
Merge changes from other branch
git merge origin branch_name
Pick up one file from another branch
git checkout branch_name file_name
Rename a branch locally and remotely
git branch -m new_name
git push origin -u new_name
git push origin --delete old_nameDelete a branch
git branch -d branch_name
git push origin --delete branch_nameM and D can be used to force the process.