/blog notes

portfolio & contact info

collaboration workflows for git & github

intro

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

  1. created new repo (on github)
  2. wrote and committed readme.md and .env files (on github)
  3. cloned (locally)
  4. edited readme.md and wrote to a new js file (locally)
  5. added and commited changes (locally)
  6. branched (on github)
  7. edited readme.md and wrote to a new js file in master (on github)
  8. committed changes to the branch (on github)
  9. git fetch --all to fetch all remote branches
  10. optional git branch -a to see full list of branches
  11. git branch --track firstBranch origin/firstBranch to make new branch and set it to track the corresponding remote branch
  12. optional git checkout firstBranch to switch to that branch
  13. optional git diff or git difftool
  14. git config merge.conflictstyle diff3 to set the default style of merging
  15. from master, merge firstBranch
  16. optional git merge --abort to abandon attempted merge, otherwise add, commit, push

about the git index aka staging area

  • git status shows differences between working directory, index and most recent commit
  • git ls-files shows files in the index

diff tools

merge tools

general links

started 2016-12-14