#Git Lecture Notes
##Topics Discussed
- SSH, public key authentication.
- Version Control
- Git Basics
- Git Workflow
- Github
- Extra git commands
- Git GUI's
##SSH
###Installing ssh
sudo apt-get install openssh
###Connecting to server
$ ssh username@hostname
###Public key authentication
ssh-keygen -t rsa
The private key is at ~/.ssh/id_rsa while the private key is at ~/.ssh/id_rsa.pub
The server needs your public key to authenticate the connection.
##Version Control
- central VCS v/s Distributed VCS
- Why Version Control
- Helps remember history of project
- Move back and forth in history
- Any break in code can be fixed easily
- Any bugs introduced can be traced back to the code that made it
- Examples : svn, cvs, mercurial, bzr, etc
##Git Basics This is just a simple walkthrough. You are encouraged to try out these steps on your own.
git initcreates a new repositorygit add <filename>adds files to indexgit add .adds everything to indexgit commitcreates a commitgit commit -aadds all modified files to the index and starts a commit- A blank commit message aborts the commit
git checkout <??>changes your working directory to a commit/tag/branchgit checkout -b branchnamecreates a new branch and shifts to itgit branchshows a list of all branches & the current branchgit merge branchnamemerges the branch with the current branchgit tagmarks a tag for the current commit
##Little of git-jargon Read more over here
branchis an active line of development.commitis a snapshot of the working directorytagis an alias of a particular commitHEADis a pointer to the current checked out branchtreeis the internal representation of working directory in gitblobis the internal representation of files in gitindexis a staging area for the commit in progress
##Git workflow
Mainly from here
Topics include branches, stable, hotfix, release, development, feature branch etc.
##Github
- http://github.com is an awesome site that allows people to share code, projects and colloborate easily using git.
- Create an account
- Setting up ssh-keys
- Creating repository
- Setting
remotes push,pull,fetch,merge- Github gem
##Some other things
git logallows you to see your historygit log --onelinegives single line historygit log --prettygives better outputgit log --graphshows your commit graph- Git GUI Systems -
gitg,git-cola,qgit,giggleand the windows git-gui as well. .gitignorefile to store system specific stuff (configuration, databases, temp files, cache, build)
##Redmine
- Create user accounts
git config user.nameandgit config user.emailshould be setup- Pass along the public keys (via email)
#Resources on Git