Convention to put them on separate lines in alphabetical order.
HEAD
can be used instead of <hash>
to specify the most recent commit.
git branch
: list of git branches
git checkout <hash>
: pull up snapshot of repository at certain commit
git checkout -b <branchname>
: create a new branch
git checkout <branchname>
: checkout an existing branch
git merge <branchname>
: merge <branchname>
to the current branch you are on.
git merge <branch1> <branch2>
: merge <branch1>
onto <branch2>
.
git push origin <branchname>
: push commits on current branch (does not necessarily have to be same branch) into <branchname>
on github.com
git checkout master
: revert back to most recent commit
git cat <filename>
: displays code
git tag (-d) <tagname>
: tags/names a snapshot for easier reference. -d
is used to delete a tag
git hist master --all
: reveals tags and which commit you are currently checked out
git reset (--hard) <hash> <filename>
: reset file to whatever was in HEAD commit. --hard
indicates working directory should be consistent with new branch head
git revert <hash>
: revert a commit
git ci --amend -m "<commend message>"
: edit/modify the last commit and commit message
git ci -am "<command message>"
: add and commit all unstaged files
git checkout -b <branchname>
: short for git branch <branchname>
followed by git checkout <branchname>
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
type = cat-file -t
dump = cat-file -p
https://docs.google.com/presentation/d/1u443XbNOfYfl1xmjDpBfSnwX8yjwqOWOybdzQLvApCo/
heroku
...
create <app-name>
open
logs -n 1000
run <command>
info
status
console
rails db:fixtures:load
: load fixture data into developmental database
`rails new . --api: create new rails project for api