-
Notifications
You must be signed in to change notification settings - Fork 8
git_github_notes
Link to my presentation on Git/Github on SpeakerDeck
Please find below instructions for the following tasks
- Install & set up Git
- Configure Github and access the course repository
You can install git using the binaries available for download at git-scm.com/downloads

Next, configure your Git with necessary/reasonable defaults, by running it on your terminal/command prompt/power shell
$ git config --global user.name <YOUR NAME>
$ git config --global user.email <YOUR EMAIL ADDRESS>
Also, it might be helpful if you ran this:
$ git config --global push.default current
which ensures that when you push it takes the current branch by default.
Once installed proceed to set up your Github
- Request an educational account from github : github.com/edu
- Set up your SSH keys for your account
- Go to
Account Settings > SSH Keysgithub.com/settings/ssh to view/create SSH keys, for your machine.- To create your SSH key, follow the Generating SSH Key instructions
- Go to
- Clone Course Repository on your workspace machine (it is up to you to use ISchool server machine or your local machine)
-
Go to Course Repository page, and copy the repository url. Make sure you are copying the SSH version of the url.
- It should be :
git@github.com:jretz/datamining290.git
- It should be :
-
Create your own Github repository for doing the course work.
- Click on
New Repositorybutton and fill in the details, as shown in the figure - Make your repository Private
- Make sure you UNCHECK the Initialize the repository with a README file, and also leave the Ignore Files and License File checkboxes as NONE (as shown in the figure)

-
Copy your Github repository URL. Lets call it
<YOUR_GH_REPO_URL> - Add Jimmy (
@jretz) and Me (@seekshreyas) as collaborators in your private repository, so we can see your files.- You can add collaborators at:
Repo Settings > Collaborators 
- You can add collaborators at:
- Click on
-
Open your terminal (on Mac/Linux) or powershell (on Windows), and navigate to the desired folder/directory where you would like to download and set up the course repository. Then,
-
Clone the repository on your machine
$ git clone git@github.com:jretz/datamining290.git <FOLDERNAME (optional)>
-
Navigate to the repository folder
$ cd <FOLDERNAME>
-
Update the remotes of the the repository.
-
Check the current remotes first
$ git remote -v- It should look something like this:
jimmy git@github.com:jretz/datamining290.git (fetch) jimmy git@github.com:jretz/datamining290.git (push)
-
Modify the remotes:
$ git remote rename origin jimmy $ git remote add origin (YOUR_GH_REPO_URL)
-
Check the remotes again, with
$ git remote -vcommand. It should show something like this:jimmy git@github.com:jretz/datamining290.git (fetch) jimmy git@github.com:jretz/datamining290.git (push) origin git@github.com:seekshreyas/datamining290T.git (fetch) origin git@github.com:seekshreyas/datamining290T.git (push)
-
-
Clone the repository on your machine
-
Thats it you have successfully set up the course repository on your machine.
Following links are useful as Git resources
- Quick Git Command Reference
- Detailed Git Reference
- Git Book: Pro Git
Some sensible configurations, shortcuts and aliases. I leave to the individuals to figure out themselves on how to implement them.
[alias]
# View the SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph
# View the current working tree status using the short format
s = status -s
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git diff --patch-with-stat"
# Clone a repository including all submodules
c = clone --recursive
[color]
# Use colors in Git commands that are capable of colored output when outputting to the terminal
ui = auto
[merge]
# Include summaries of merged commits in newly created merge commit messages
log = true