标签:style 标签 本地 col 链接 key comment 需要 测试
1.牛逼的互联网,牛逼的大神们都在用
2.完整的版本控制功能,解决多人协作的问题
3.提高开发效率
4.如果你是程序猿,请务必学习git,并习惯把自己的代码同步到github上
5.git不等于github,git和github的关系是球和球场的关系!!
地址:https://git-scm.com/download/win
配置
因为git是分布式版本控制系统
所以每个系统都需要报自己的家门,安装完成需要配置用户信息
//配置用户 git config --global user.name "lqluo" //配置邮箱 git config --global user.email "liqi.luo@newtouch.cn" //查看配置的信息 git config --list
下载地址:https://www.sourcetreeapp.com/
//查看目录下是否初始化了git本地仓库 ls -a //初始化本地仓库 git init //查看当前仓库的状态(本地是否有代码没有提交) git status //添加文件到暂存区 git add //提交文件到本地仓库 git commit -m "" //hard 是本地仓库和暂存区都回滚 git reset --hard adad //(工作区清空了,但是暂存区和仓库还没清空) git rm test.txt //本地生成pubkey,用来链接远程仓库,邮箱需要是github注册的邮箱 ssh-keygen -t rsa -C "llq1214@163.com" //测试本地和是否连上远程仓库 ssh -T git@github.com //本地仓库与远程仓库关联 git remote add origin git@github.com:flyerL/git_demo.git //提交代码到远程仓库 //-u 是本地仓库与github仓库关联上,下次提交可以直接git push git push -u origin master //克隆代码到本地仓库 git clone git@github.com:flyerL/git_demo.git // “>>” 表示追加到clone.txt echo "clone demo" >> clone.txt
//查看你所有分支 //带星号的分支表示当前代码所在的分支 git branch //创建分支 git branch name //切换分支 git checkout name //合并分支,假如当前在master分支,将feature_x分支的代码合并到master git merge feature_x //删除分支 git branch -d feature_x
//查看所有标签 git tag //创建标签 git tag name //指定提交信息 git tag -a name -m "comment" //删除标签 git tag -d name //标签发布 git push origin name
标签:style 标签 本地 col 链接 key comment 需要 测试
原文地址:https://www.cnblogs.com/llq1214/p/9700936.html