目标:下载Github上Spring FrameWork 3.2.8 release 的源码到本地。
首先,这是一个关于git指令的游戏教程,20分钟左右可完成,强力推荐:
http://try.github.io/levels/1/challenges/1
这儿是git电子书地址 http://git-scm.com/book ,有中文版的哦!
先看几个为完成目标必须了解的东西
2.6 Git Basics - Tagging
git tag // 显示所有tag
git tag -a v1.4 -m 'my version 1.4' // 创建叫 v1.4 的tag,-m 加注释
git show v1.4
git push origin v1.4 // 将 v1.4 tag推送到remote repo
git push origin --tags // 将所有本地tag推送到remote repo
开始完成设定目标:
1. 访问 https://github.com/spring-projects/spring-framework ,点击Fork
2. 打开Git Bash
3. cd /e/code_base/github/spring-projects/spring-framework
4. git clone https://github.com/klg0705/spring-framework.git
5. git checkout v3.2.8.RELEASE
完工!
PS1:从 tag里面checkout的代码是无法提交的,如果想提交修改,必须建一个branch
git checkout -b myUpdate
PS2:当时创建目录时多了一层,应该是cd /e/code_base/github/spring-projects。如何移动呢?
直接复制粘贴就行,我想太多了……