git是一款开源的分布式版本控制工具。svn是集中式的。分布式就是服务端和客户端都有一个代码仓库
git 最快,最简单,最流行的。2005,4月三号到7月,就写完了,(Linux)里拉斯写的
git svn对比:速度比svn快,svn使用分支比较笨拙,git可以轻松拥有无限个分支,svn必须联网才能工作,git支持本地版本控制工作,svn集中式,git分布式
svn工作流程,去公司先吧你公司代码下载到你的电脑,后提交到服务器,其他人想要代码,直接update,
git clone 连仓库一块下载下来,本地也有仓库,编码完后,注意,svn的commit是提交到服务器,git的commit是提交到本地仓库,同步到服务器,就push,其他人想要代码则PULL拉下来
在mac上,比较好用的git图形界面客户端有:sourceTree,也可以用github,Xcode 也可以,但都是简单操作。比如clone,提交。
命令行操作git,
1,新建一个本地仓库,打开终端-cd-manager-pwd-进入经理文件夹,--创建一个本地仓库,git init初始化一个本地仓库回车
Reinitialized existing Git repository in /Users/andy/Desktop/manager/.git/
2.配置仓库如果你的电脑从来没有使用过git,你应该告诉git你是谁, git config user.name lnj,告诉git怎么联系你。git config user.email lnj@itcast.cn,上面一种配置方式是一次性配置,会配置到被管理文件的。git文件夹,下面一种配置方式是逸劳永逸的。git config --global user.name lmj 然后 git config user.email lmj@itcast.cn,
3如何学习git指令和svn学习是一样的,只不过展现的方式不一样,git是通过使用指南的方式告诉我们某个指令如何使用,这个指令其实是不可vim的
Q是退出指南。按空格是下一页 control +8 上一页 /需要搜索的内容,可以进行一个搜索
注意指南 git --help 和比如 git help clone
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Switch branches or restore working tree files
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty Git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and integrate with another repository or a local branch
push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG
原文:http://www.cnblogs.com/yangliangliang/p/4970132.html