*. How to create patch in GIT pro?
1.git pull
2.Edit the files
3.git diff > name.patch
*. How to land patch:
1.git add
(if the file is not a new fone, ingore this step)
2.git commit -m "add ior-survey.sh into lustre/test" lustre/tests/ior-survey.sh
3.git push
*.How to get project
git clone --origin prime git://git.lustre.org/prime/lustre.git
or
git clone --origin prime git@git.lustre.org:prime/lustre.git
cd
git clone --origin hsm git@git.lustre.org:hsm/lustre.git HSM
The "--origin prime" option is just a reminder that this is the official repo source. You'll see this name in the remote branch list below.
Set up other remote tracking branches you may want. First see what's available:
git branch -r
prime/b1_6
prime/b1_8
prime/b_release_1_6_7
prime/b_release_1_8_0
prime/b_release_1_8_1
prime/master
Then set up local copies of the branches you are interested in. For example:
git branch b1_8 prime/b1_8
git branch b_release_1_8_1 prime/b_release_1_8_1
...
You can then switch amongst the branches with:
git checkout b1_8
Or you can do the above two steps (i.e. set up the remote tracking branch and switch to it) in one operation with:
git checkout -b b1_8 prime/b1_8
*. Make patch:
git status
git add file
git diff HEAD > vim-cocoa.patch
*. See the landing date:
"git show --pretty=fuller commit"
*.To reset the code to the latest commit
git checkout -f
阅读(983) | 评论(0) | 转发(0) |