show code js
2013年5月23日 星期四
git use share with dropbox
Server:
1.get dropbox account and download & install dropbox
2.download and install git
3.goto dropbox website
(A)create a new_project.git
(B)right click this folder and click share with (not use link)
4.goto dropbox folder on computer
(A)cd ~/Dropbox/
(B)cd new_project.git and command:git init --bare [to format]
Client:
1.Config
(A)git config --global user.name "your name"
(B)git config --global user.email youremail
2.New project
(A)mkdir your project
(B)cd project
(C)git init
(D)git remote add origin ~/Dropbox/project/myproj.git
3.create a project from server
(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
Upload:
1.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
2.modify and update to git server
(A)git commit -m "desc:modify"
(B)first time:git push origin master, next time:git push
Download
1.update from git server
(A)first time:git pull origin master, next time:git pull
Add ignore:
1.add a .gitignore in project root directory and set
data/*
xml/*.dat
password.file
See log:
1.git log
Mirror a new project :
mkdir ../new_directory
git archive master | tar -x -C ../new_directory
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言