Git

From Ittichai Chammavanijakul's Wiki
Revision as of 17:59, 30 January 2012 by Ittichai (talk | contribs)
Jump to navigation Jump to search

Git

Git is an open-source, distributed version control repository system.

http://git-scm.com/

Installing Git

http://progit.org/book/ch1-4.html

Installing Git on Windows

  • Download Installer and run it.
  • Choose all default settings (for now).

Repository

Launch Git Gui.

Create New Repository.

Specify path.

Syntaxes

  • Cretae an alias for check out.
$ git config --global alias.co checkout
  • Set the default editor.
$ git config --global core.editor notepad++.exe
  • Initialize git for the first time.
$ cd first_app
$ git init
Initialized empty Git repository in ../Rails_Projects/first_app/.git/

  • Add the ignore list.
$ cd first_app
$ vi .gitignore
$ cat .gitignore
.bundle
db/*.sqlite3*
log/*.log
*.log
/tmp/
doc/
*.swp
*~
.project
.DS_Store
  • Add all
$ git add .
  • Check status
$ git status
  • Commit
$ git commit -m “Initial Commit”