show code js

2012年9月9日 星期日

git on mac


Server:
1.get dropbox account and download & install dropbox
2.download and install git
3.goto dropbox directory
(A)mkdir project [for all git root]
(B)cd project and mkdir new_project.git
(C)cd new_project.git and command:git init --bare [to format]

Client:
1.New directory
(A)mkdir a project
(B)cd project
(C)git init
(D)git remote add origin ~/Dropbox/project/myproj.git

2.from a project
(A)git init or git clone ~/Dropbox/project/myproj.git [to format and get code from git server]
(B)git remote add origin ~/Dropbox/project/myproj.git

3.add new document to git server
(A)git add filename.xxx
(B)git commit {-a} -m "Add a filename.xxx"
(C)first time:git push origin master, next time:git push

4.modify and update to git server
(A)git commit -m "desc:modify"
(B)first time:git push origin master, next time:git push

5.update from git server
(A)first time:git pull origin master, next time:git pull

6.add ignore:
add a .gitignore in project root directory and set
data/*
xml/*.dat
password.file

7.see log
(A)git log


8.mirror a new project :
mkdir ../new_directory
git archive master | tar -x -C ../new_directory

沒有留言:

張貼留言