Git Guide For People New to Git

Installing GIT

  • mac: $brew install git or use the graphical install at http://code.google.com/p/git-osx-installer
  • linux: $apt-get install git-core or $yum install git-core
  • windows: http://code.google.com/p/msysgit

Configuring GIT

  • $ git config –global user.name “Your Name”
  • $ git config –global user.email youremail@email.com

Getting files from our repository

  • The first time, do: $git clone git://github.com/aardvarkium/NAMEOFPROJECT
  • Afterwards: $git pull

Checking in files (just do it and don’t be nervous about it!)

  • $git add .
  • $git commit
    • You should see a screen that shows you the files you’ll be checking in. Make sure they are correct, and then type in a message that describes your changes. For example, “Changed the readme file to explain the install process on windows.” or “Added geocaching to the locations controller.”
  • or to quickly add everything and type your message in one shot, you can use the command: $git commit -a -m “Message goes here”
  • $git push

Creating a new project

  • $git init
  • $git add .
  • $git commit

Adding forgotten files to a commit

  • $ git commit -m ‘initial commit’
  • $ git add forgotten_file
  • $ git commit –amend

Comments are closed.