Presentation on theme: "Quick Guide To Git & Wiki. Why We Need Version Control Group projects – Prevents loss of code when trying to merge versions – Allows Individual projects."— Presentation transcript:
Quick Guide To Git & Wiki
Why We Need Version Control Group projects – Prevents loss of code when trying to merge versions – Allows Individual projects – Create a branch during debugging to keep track of changes and avoid accidental introduction of errors – Defines a central version of the code when working in multiple locations
Installing it on your Mac If you have Snow Leopard or Lion (10.6 or newer): – If you have Mac OS 10.5 or older: – installer/downloads/detail?name=git i386- leopard.dmg&can=2 osx-installer/downloads/detail?name=git x86_64-leopard.dmg&can=2 installer/downloads/detail?name=git i386- leopard.dmg&can=2http://code.google.com/p/git- osx-installer/downloads/detail?name=git x86_64-leopard.dmg&can=2 – Check your hardware: second link requires 64-bit chip
How the Git Server Works Main Branch Working Directory A CloneEdit Stage Commit Initialize
How the Git Server Works Main Branch Working Directory A Working Directory B CloneEdit Stage Commit Clone Edit Stage Error: Version Conflict Pull Merge Stage Commit Initialize
Initializing a Git Repository Init – Creates a /.git object in the current directory – To create a shared git git init –shared foo.git chgrp –R groupname foo.git Add – This does not commit the files to the git, just adds files to the list of tracked objects – Standard Linux trick apply, e.g. git add *.py will add all Python files in the current directory Push – Used to import an old repository into a new one
Global Configuration Steps Set your name and for the tracking logs: – git config –global user.name “Your Name” – git config –global user.
Getting Code from the Git Repo Clone: git clone – Unlike “checkout” used by other programs, creates a complete duplicate of the code – Easier for multiple people to work on the same file simultaneously Pull – Allows you to look at someone else’s code without committing changes to the central version – For multiple users, copies any commits that have been made since you last cloned to your clone before you can merge back to the main branch EXAMPLE: git clone ssh://titicaca.engin.umich.edu/home/code/GAS.git
Making Changes in the Git Status – Checking which files have been modified/added – Identifies what’s been modified and staged Staging Branching Creates new branch, great for debugging
Committing to Change Commiting – Initial commit defines the main branch of the code git commit –a both adds and commits a file to the main branch – Later commits merge changes from branches into the main code Must include a commit message!
Getting Help for Git om.up.pdf om.up.pdf docs/gittutorial.html docs/gittutorial.html
Graphical Interfaces More comprehensive list: https://git.wiki.kernel.org/index.php/Interface sFrontendsAndTools#Web_Interface
Wiki 101 Create an account – Have Katie or Mike log in as WikiSysop – Go to Special:UserLogin Click this Change this You will get an error about the address: still working out why, but your account will be set up! Fill out the form
Navigating Wiki Editing To create a header: ==Header Text== – More ‘=‘ demotes the heading in the outline (e.g., Section 3 to Section 2.1) Formatting basics: – ‘’italic’’ – ‘’’bold’’’ – ‘’’’bold & italic’’’’ – text – ignores wiki ‘’markup’’ – * bullet – ** indented bullet HTML symbols Still sorting out math libraries
Creating New Pages/ Linking To create a new page in the Wiki, you have to create a link to it from somewhere else Links are formatted as: – [http://example.org/index.php DISPLAY TEXT]