collaboration workflows for git & github
These are notes about using git and github hosted repos as a collaborative tool. They were written while working on nearmeow.
From the git repo readme:
Git - the stupid content tracker
"git" can mean anything, depending on your mood.
- random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of "get" may or may not be relevant.
- stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang.
- "global information tracker": you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room.
- "goddamn idiotic truckload of sh*t": when it breaks
list of resources from github
official git user manual
solution to attempted branch switching resulting in a detached HEAD state.
steps taken in the example repo
- created new repo (on github)
- wrote and committed readme.md and .env files (on github)
- cloned (locally)
- edited readme.md and wrote to a new js file (locally)
- added and commited changes (locally)
- branched (on github)
- edited readme.md and wrote to a new js file in master (on github)
- committed changes to the branch (on github)
git fetch --allto fetch all remote branches
- equivalent to
git remote updatemore info
- equivalent to
git branch -ato see full list of branches
git branch --track firstBranch origin/firstBranchto make new branch and set it to track the corresponding remote branch
git checkout firstBranchto switch to that branch
git config merge.conflictstyle diff3to set the default style of merging
- from master,
git merge --abortto abandon attempted merge, otherwise add, commit, push
about the git index aka staging area
git statusshows differences between working directory, index and most recent commit
git ls-filesshows files in the index