Group Software

This is what you need to do obtain the group's software:

General setup for git and github

1. Sign up for github: https://github.com

2. Install git: http://git-scm.com/downloads

3. Type in the following in your terminal: git config --global user.name "Your Name"

4. Type: git config --global user.email "your email address"

Optional: You can also move away from the command line and install software that provides a GUI. For mac, I use SourceTree.

Downloading the group software

1. Create a folder where you want to place the files from the repository and go to that folder.

[In linux this would be "mkdir name_of_dir" to create a folder and "cd name_of_dir" to go to that folder.]

2. Type: git init

3. Type: git remote add origin https://github.com/kusumaatmaja/softwarename/ [This is to tell git where the repository is located. Ask Halim for "softwarename".]

3b. In Hamilton, you need to open the file called ".git/config". Then edit such that under remote "origin", you have

[remote "origin"]

url = https://your_username@github.com/kusumaatmaja/softwarename/

fetch = +refs/heads/*:refs/remotes/origin/*

[branch "master"]

remote = origin

merge = refs/heads/master

4. Type: "git fetch" then "git pull". You should now get the group's latest software.

Common commands you need to know

1. git pull

This is to tell git you want the latest files. This is the first thing you do when you interact with the repository, before you commit anything new.

2. git add “filename”

This is to stage a file called "filename" (you can also do many files at the same time). This is to say you want to include the file in your commit.

3. git rm “filename”

This is to remove a file from the repository called "filename". Please be careful when removing a file. Make sure noone else is using this file.

4. git commit -m “Short explanation what you have done”

It is good practise to briefly say what are the changes you have committed. Never leave this blank or you owe the group a beer.

5. git push

This is to actually copy files from your local folder to the online repository.

6. git diff HEAD "filename"

This is to differentiate your copy and the repository copy of "filename". You can change HEAD to HEAD~n to compare against the current - n version.

7. git revert and git reset

This is if you want to go back to old versions. Use this with care. Read the manual first if you ever want to use it.

A wiser choice is to use "git checkout HEAD~n filename", and the recommit and push as before.

8. git blame "filename"

This is to trace changes on the file "filename". It should tell you who to blame!

9. git log

This is to show the commit messages. Another useful command is git show - read the manual if you want to use it.

10. git status

This is to check the current state of the repository. It will tell you if there are possible conflicts, files which are different, etc; think of it as a preview.