Git入门(一)简易的命令行入门教程:
2016-04-13 22:05
651 查看
简易的命令行入门教程:
Git 全局设置:
创建 GIT 仓库:
克隆到本地:
添加所有文件到暂存区:
删除版本库的文件:
拉取到本地:
将本地主分支推到远程主分支:
将远程主分支合并到当前主分支:
Git 全局设置:
git config --global user.name "NicholasYao" git config --global user.email "414255115@qq.com"
创建 GIT 仓库:
mkdir TikuApp cd TikuApp git init touch README.md git add README.md git commit -m "first commit" git remote add origin https://git.oschina.net/youraccount/yourproject.git git push -u origin master
克隆到本地:
<pre class="dark" style="box-sizing: inherit; overflow: auto; font-family: Menlo, "Liberation Mono", Consolas, "DejaVu Sans Mono", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; color: rgb(245, 245, 245); padding: 10px; font-size: 15px; line-height: 19.95px; background: rgb(51, 51, 51);">git clone</pre> </p>
添加所有文件到暂存区:
<pre class="dark" style="box-sizing: inherit; overflow: auto; font-family: Menlo, "Liberation Mono", Consolas, "DejaVu Sans Mono", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; color: rgb(245, 245, 245); padding: 10px; line-height: 19.95px; background: rgb(51, 51, 51);">git add .</pre> </p>
删除版本库的文件:
<pre class="dark" style="box-sizing: inherit; overflow: auto; font-family: Menlo, "Liberation Mono", Consolas, "DejaVu Sans Mono", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; color: rgb(245, 245, 245); padding: 10px; line-height: 19.95px; background: rgb(51, 51, 51);">git rm <file></pre> </p>
拉取到本地:
<pre class="dark" style="box-sizing: inherit; overflow: auto; font-family: Menlo, "Liberation Mono", Consolas, "DejaVu Sans Mono", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; color: rgb(245, 245, 245); padding: 10px; line-height: 19.95px; background: rgb(51, 51, 51);">git pull</pre> </p>
将本地主分支推到远程主分支:
<pre class="dark" style="box-sizing: inherit; overflow: auto; font-family: Menlo, "Liberation Mono", Consolas, "DejaVu Sans Mono", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; color: rgb(245, 245, 245); padding: 10px; line-height: 19.95px; background: rgb(51, 51, 51);">git push origin master</pre> </p>
将远程主分支合并到当前主分支:
<pre class="dark" style="box-sizing: inherit; overflow: auto; font-family: Menlo, "Liberation Mono", Consolas, "DejaVu Sans Mono", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; color: rgb(245, 245, 245); padding: 10px; line-height: 19.95px; background: rgb(51, 51, 51);">git merge origin/master</pre> </p>
相关文章推荐
- RPC failed; result=22, HTTP code = 411
- git更新已經刪除的文件
- 提取Git每次提交后Commit的文件
- GIT迁移服务器
- 分布式版本管理git入门指南使用资料汇总及文章推荐
- git终极指南:在实际开发中的应用
- 简单谈谈node.js 版本控制 nvm和 n
- VSS 软件配置管理 版本控制第1/2页
- Git远程操作详解
- 25个 Git 进阶技巧(翻译)
- 详解版本控制利器Git,SVN的异同以及适用范围
- 使用svn进行版本控制
- Ruby实现的删除已经合并的git分支脚本分享
- 在 Shell 提示符中显示 Git 分支名称的方法
- Git使用基础篇(一些常用命令和原理)
- git fork同步是什么意思?
- Git使用小坑 Out of memory错误的解决方法
- Python的高级Git库 Gittle
- 使用GIT进行源码管理――GUI客户端小结
- 使用git代替FTP部署代码到服务器的例子