Thursday, April 19, 2012

GIT Commands - My notes from Michael Hartl's Rails Tutorial

# initial one-time setup
git config --global <options> 

#Necessary each time you create a new repository.
#Commands need to be executed from the the project directory. Eg : C:/rails_tutorial/first_app

# To initialize a new repository
git init


#To add the current directory files to the initalized GIT repository
git add .
# To see the pending changes to your project(first_app)
git status

# To commit the project's changes into the GIT repo
git commit -m "Initial commit"

# To see the list of commits
git log

#Ignore all current changes. Copy the GIT repo contents to the current directory
git checkout -f




Pushing Project To GITHUB

  1. Create a user account on github.com
  2. Create a new repository on github.com for this project. (For each project, create new repositories)
  3. Hit the following commands from your project folder (change the username/project.git according to yours)
git remote add origin git@github.com:thyag/junk.git
#you might have to enter your github passphrase now

git push -u origin master