Difference between revisions of "Git"

From Ittichai Chammavanijakul's Wiki
Jump to navigation Jump to search
Line 16: Line 16:
  
 
== Repository ==
 
== Repository ==
Launch Git Gui
+
Launch Git Gui.
  
Create New Repository
+
Create New Repository.
  
Specify path
+
Specify path.
  
 
== Syntaxes ==
 
== Syntaxes ==
* Cretae an alias for check out
+
* Cretae an alias for check out.
 
<pre>
 
<pre>
 
$ git config --global alias.co checkout
 
$ git config --global alias.co checkout
 
</pre>
 
</pre>
  
* Set the default editor
+
* Set the default editor.
 
<pre>
 
<pre>
 
$ git config --global core.editor notepad++.exe
 
$ git config --global core.editor notepad++.exe
 
</pre>
 
</pre>
  
* First time setup for application
+
* Initialize git for the first time.
  
 
<pre>
 
<pre>
Line 42: Line 42:
 
</pre>
 
</pre>
  
* Add the ignore list
+
* Add the ignore list.
 
<pre>
 
<pre>
 
$ cd first_app
 
$ cd first_app
Line 57: Line 57:
 
.project
 
.project
 
.DS_Store
 
.DS_Store
 +
</pre>
 +
 +
* Add all
 +
<pre>
 +
$ git add .
 +
</pre>
 +
 +
* Check status
 +
<pre>
 +
$ git status
 +
</pre>
  
 +
* Commit
 +
<pre>
 +
$ git commit -m “Initial Commit”
 
</pre>
 
</pre>

Revision as of 17:59, 30 January 2012

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”