A deliberately minimal set of commands for using GIT as simply as possible. Note:
- GIT will ask for some details the first time you use it on a machine
- these instructions will need a repo on GitHub for you to push to
- don't create a readme.md file on GitHub, make it locally and push
git initgit statusgit add .git commit -m "describe change"git statusgit remote add origin URL_of_remote_repo_heregit remote -vgit push -u origin master
git clone URL_of_remote_repo_here- (do some work)
git add .git commit -m "describe change"git statusgit push
git checkout -b branchname_here- (do some work)
git add .git commit -m “describe change”- (repeat 2-4)
git push -u origin branchname_heregit checkout mastergit diff master branchname_here- (repeat 2-4 if necessary)
git merge branchname_here- (repeat 2-4 if necessary)
git branch -a(lists all branches)git branch -d(use-Dto force delete)
git log --pretty=onelinegit fetch origin(override local changes)git reset --hard origin/mastergit checkout -- filename_here(restore previous version of file)git reset —hard HEAD~(revert to previous commit)
git clone URL_of_remote_repogit remote set-url origin URL_of_NEW_repogit remote -v