2012年2月18日 星期六

[linux tool] git


Here's how you start a project with GIT.
0. Download git package or source code

Git - Fast Version Control System

When download the package then click twice.
Package will be installed.
1. set yourself up to use GIT:

git config --global user.name "My Name"
git config --global user.email me@mydomain.com
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto

2. Init (Create Repository)

cd Project_name
type git init
then create .git under Project_name
After put  some thing into it.
So execute step 3.

3. Add some file
git add *

4. commit ( write some comment to this time of change )
git commit -m 'my hola mundo changes'  ( 'my hola mundo changes' <-- any comment you want )
 
Reference :
----------------------------------------------------------------------------------------
Push ( Push local file to remote )
1. Check how many branch in local
git branch
* master

2. Create another branch called Good_job
git branch Good_job

3. Switch master branch to Good_job branch
git checkout BeforeThePushBranch
Switched to branch 'BeforeThePushBranch'

4. Upload to remote repository
git push ../TI/.git/ BeforeThePushBranch

Reference :

0 意見:

張貼留言