Skip to content
Mark Anderson edited this page Sep 20, 2013 · 3 revisions

git

git text editor

git uses as standard text editor the VI. however, it's not an easy program to navigate (I couldn't even get out of it and got caught). to change the standard text editor of git to Nano, place the following command in Terminal: git config --global core.editor "nano"

If you are stuck in VI, then you can get out with the following sequence:

escape : wq enter

git folder

to make sure your (in this case) ExperimentalMedia folder (in the openFrameworks folder) is defined as a git folder, check with ls -la if there's a .git document present. If you wanted to make a new repo on your desktop and make it a git folder, you can initialize it: git init

git status

to figure out what status your desktop git is, use git status while anywhere in your git folder. Very handy to have an idea about the changes on your desktop compared to your git repo. Also good to see if you did commit your new files.

git timeline

  1. On git dashboard (browser): fork a repo from anywhere (eg. bakercp) to your git profile.
  2. clone it down to your desktop in Terminal: go to your openFrameworks folder, then git clone <url> (using the URL provided on the git website of your fork, down right corner) 2a. Define the original of where you forked your repo (called "upstream"): git remote add upstream https://github.com/bakercp/ExperimentalMedia That way you can later sync it again with your desktop version, if other people contributed to the original in the meantime.
  3. Make some changes, new folders, new documents, new code
  4. Check with git status and it will tell you there are untracked changes.
  5. Add (prepare) those changes for the next commit: git add "new file"
  6. Commit the new changes to your repo: git commit -m "comment about changes" The -m is to directly write the comment in one go. If you only say git commit it will get you in the standard text editor (see above) to write a commit.
  7. git push origin will push your new changes to the forked repo on your profile. Otherwise the commits went only to Chris and your forked repo is outdated.
  8. On the git dashboard (browser): issue a pull request to get your changes re-integrated into the original.
  9. Sync with the original when there have been other contributions: git pull upstream master

Terminal

nice little list of basic commands - http://www.bios.niu.edu/johns/bioinform/linuxcom.html

intro to sed - http://www.ibm.com/developerworks/library/l-sed1/index.html

regex refresher: http://www.ibm.com/developerworks/library/l-sed1/index.html#h10

very comprehensive (though possibly poorly/obnoxiously written) guide to a bunch of stuff, including working with text, grep, find and replace type stuff regex, etc - http://www.grymoire.com/Unix/

btw, if your eyes got equally tired of staring into Terminal, having coloured text might help: http://osxdaily.com/2013/02/05/improve-terminal-appearance-mac-os-x/

Clone this wiki locally