- Authenticates your access to private repos
- Is a key unique to you
- Yubikeys will replace this once we get you setup
ssh-add -L # If this has a value use this in github
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_goodeggs_rsa
ssh-add ~/.ssh/id_goodeggs_rsa
ssh-add -L # Put this key in github
ssh -T git@github.com
if you need to check the github host keys (to accept) see LINK
- Add your key to github after you've signed in
- Side note, I need everyone's github username to add as a collaborator
- This Repo
- This gives you a LOCAL copy to your workstation
- Creates a new REMOTE with a special name of
origin
(all you need for our use case) - We are NOT creating a FORK, everyone has permissions on the main repo
- If your work comes from pivotal, lookup your ticket #
- BRANCH
git checkout -b your-branch-name
git branch
shows you the branch you're on- ADD STAGES your changes to the index
git add <filename>
git status
shows you what files changed and what's on the index- COMMIT them to your branch
git commit
logs your changes with a comment
git diff
shows you what's different (origin/master, HEAD^, HEAD^^).gitignore
files that don't need to be tracked
git reset <filename>
- discard commits on a private branch (local) or throw away uncommited changes
- with a filename unstages a file
git checkout <filename>
undoes changes to latest commited version or point in history
- PUSH to github (Publishes your changes so others can see)
- open a PULL REQUEST
- Have a teammate do a code review
- Make sure CI completes
- Merge your PR after success!
git branch -D <branchname>
deletes a local branchgit remote prune origin
cleans up your local tracking againstorigin
-- after the remote branch was deleted following a pull requestgit push origin --delete <remote-branch>
Deletes a remote branch without merge Bail Out!
git remote show origin
shows you what's going on with theorigin
git fetch
Updates your clone get changes fromorigin
git pull
shortcut to pull in the latest version of a tracked branch (on your current branch)git checkout -b <remotebranch> origin/<remotebranch>
Pulls in a branch somebody else shared
git rebase master
git merge
- Resolving conflicts
git log
git blame <filename>
git diff
git revert
-- replays history in reverse
git branch
git stash
git checkout
git tag
git cherry-pick <sha of change>
git rebase -i <your historical commit>
git push -f
force push (overwrite) to remote branchgit commit --amend
don't create a new commit, just tack on to the previousgit commit --allow-empty -m '<commit message>'
do an empty commit to trigger CI