GIT和 SVN 的区别
-
SVN 是集中式版本控制系统,版本库是集中放在中央服务器的,而工作的时候,用的都是自己的电脑,所以首先要从中央服务器获得最新的版本,然后工作,工作完成后,需要把自己做完的活推送到中央服务器,集中式版本控制系统必须联网才能工作,对网络宽带要求比较高。 -
GIT是分布式版本控制系统,没有中央服务器,每个人的电脑都是一个完整的版本库,工作的时候不需要联网了,因为版本都在自己的电脑上。协同的方法是这样的:自己再电脑上改了文件A 其他人在电脑上也改了文件A 这时,你们两之间只需要把各自的修改推送给对方 就可以互相看到对方的修改了 GIT 可以直接看到更新了哪些代码和文件 GIT是目前世界上最先进的分布式版本控制系统
常见的Linux命令

pwd: print working directory 显示当前所在的目录路径
ls: list directory contents
GIT 的必要配置
- 在C:\Users\Admin\.gitconfig 个人配置下配置用户信息

GIT 的工作原理
 
GIT项目创建及克隆

GIT 基本操作

git add . 添加文件进入缓存区
git commit -m'注释信息' 提交到本地仓库
git push 推送到远程仓库
git branch 查看所有本地分支
git branch -r 查看所有远程分支
git branch [branch] 新建一个分支 但仍然停留在当前分支
git branch -d[branch] 删除分支
git checkout -b[branch] 新建一个分支并切换到当前分支
git push --set-upstream origin dev 新建一个远程分支
git merge [branch] 合并指定分支到当前分支
GIT 忽略文件

|