Git Introduction AbhishekDey Das | Sudhanshu Iyer abhis.ws | siyer.info
1 Git Basics • What is Git ? • Type of Source Control Mangement System (SCM) • … • Where does Git fit in ? • Used to manage versions of your code.
1.1 Getting a GitRepository • Create a repository on GitHub • Add your team members. • Don’t forget to add usadeydas – Abhishekroboguy – Sudhanshu
Generating Your SSH Public Key • $ ssh-keygen –t rsa 2048 • It will ask for path: • id_rsa • It will ask for a passphrase: • Leave it blank • Go to home folder: home/utd/.ssh • Copy the contents of id_rsa.pub and add it to GitHub.
1.2 Recording Changes to the Repository • Initialize Git in your project folder $ gitinit • Add the remote repostiory $ git remote add origin “URL_Goes_Here” • Add/Modify files • Check Git Status of your project $ git status • Add a ReadMe and .gitignore • Add files for commit to local repository $ git add <filename> …
1.2 Recording Changes to the Repository • Local Commit $ git commit • Push to remote master $ git push origin master Oops!! Looks like it has failed for most people
2.1 Creating Your Branch • Create Your own branch $ git checkout –b <branch-name> • Commit to your branch $ git push origin <branch-name> • Pulling from remote $ git pull origin <branch-name> • To clean $ git rebase • To check git logs $ git log
Commands Summary • Asdsad
Project 2 • Fork the repository located here: • Add your team members and us too. • The code has some bugs, each team member must fix the bugs and push it to their own branches. • Project manager shall select the best fix and push it to the team’s trunk. • We will pull one of the teams fixes into the main branch.
Project 3 • Use Acme Corp Project. • The goal is to have the entire application in the trunk using git. Small change… You need to add a module that computes square root of a number !
Some Useful resources… • Git SCM Book: http://git-scm.com/book • GitHub Help: help.github.com