github命令大全
github是一种开源的版本控制工具,现在已经得到很多人的应用。所以想介绍一下github的一些使用。
github安装
github提供了桌面客户端,我们也可以通过命令行的方式来进行控制。
windows
https://windows.github.com
mac
https://mac.github.com
配置工具
对于本地版本配置用户信息
git config --global user.name "username"
git config --global user.email "email"
上面的分别是设置用户名和邮箱
建立版本库
git init project-name
//create a new local repost with the specified name
git clone url
//download a project and its entire version history
提交变化版本
git status
// list all new of modified files to be committed
git diff
//show file differences not yet staged
git add file
//snapshot the file in preparation for versioning
git diff --staged
//show file difference between staging and the last file version
git reset file
//unstage the file, but preserve its contents
git commit -m "description message"
群组版本控制
git branch
//list all local branches in the current respority
git branch branch-name
//create a new branch
git checkout branch-name
//switch to the specific branch and update the working directory
git merge branch
//combine the specified branch's history into the current branch
git branch -d branch-name
//delete the specified branch
重构文件名
git rm [file]
//delete the file from the working directory and stage the deletion
git rm --cached [file]
//remove the file from version control but pressure the file locally
git mv [file-origin] [file-renamed]
//change the file name and prepare it for commit
排除版本控制
*.log
build/
temp-*
以.log为结尾的文件都不会被进行版本控制
git ls-files --other --ignored --exclude-standard
//list all ignored files in the project
git stash
//temprarily store all modified tracked files
git stash pop
//restore the most recently stashed files
git stash list
//list all stashed changesets
git stash drop
//discard the most recently stashed changeset
git log
//list version history for the current branch
git log --follow [file]
list version history for a file
git diff [first-branch]...[second-branch]
//show content differences between two branches
git showw [commit]
//output metadata and content change of the specified commit
git reset [commit]
//undo all commits after[commit],preserve changes locally
git reset --hard [commit]
//discard all history and changes back to the specified commit
git fetch [bookmark]
//download all history from the respority bookmark
git merge [bookmark]
github命令大全的更多相关文章
- Core dotnet 命令大全
Core dotnet 命令大全 dotnet 命令大全,让你理解dotnet 命令. 本文将以一个实例串起 dotnet 所有命令,让你玩转dotnet 命令. 本篇文章编写环境为windows 1 ...
- Git原理与命令大全
Git (wiki: en chs )是一个免费开源的分布式版本控制系统,由linux内核作者linus Torvalds开发,大型开源项目linux kernel.Android.chromium ...
- [转].NET Core dotnet 命令大全
本文转自:http://www.cnblogs.com/linezero/p/dotnet.html https://docs.microsoft.com/en-us/dotnet/articles/ ...
- 【git】Git 常用命令大全
Git 是一个很强大的分布式版本控制系统.它不但适用于管理大型开源软件的源代码,管理私人的文档和源代码也有很多优势.
- Linux 命令大全提供 500 多个 Linux 命令搜索
Linux Command 在这里维持一个持续更新的地方 516 个 Linux 命令大全,内容包含 Linux 命令手册.详解.学习,值得收藏的 Linux 命令速查手册.请原谅我写了个爬虫,爬了他 ...
- mac 终端 常用命令,MacOS 常用终端命令大全,mac 在当前目录打开终端
MacOS 常用终端命令大全:目录操作dircmp——比较两个目录的内容——dircmp dir1 dir2文件操作pg分页格式化显示文件内容——pg filenameod——显示非文本文件的内容—— ...
- 10年阿里自动化测试架构师帮您收集的:git常用命令大全以及git原理图【泣血推荐,建议收藏】
一.Git分布式版本控制简介 Git 是一个很强大的分布式版本控制系统.它不但适用于管理大型开源软件的源代码,管理私人的文档和源代码也有很多优势.本来想着只把最有用.最常用的 Git 命令记下来, ...
- .NET Core dotnet 命令大全
dotnet 命令大全,让你理解dotnet 命令. 本文将以一个实例串起 dotnet 所有命令,让你玩转dotnet 命令. 本篇文章编写环境为windows 10 ,dotnet 命令同样适用于 ...
- 【转】Hadoop命令大全
Hadoop命令大全 本节比较全面的向大家介绍一下Hadoop命令,欢迎大家一起来学习,希望通过本节的介绍大家能够掌握一些常见Hadoop命令的使用方法.下面是Hadoop命令的详细介绍. 1.列出所 ...
随机推荐
- 使用Node,Vue和ElasticSearch构建实时搜索引擎
(译者注:相关阅读:node.js,vue.js,Elasticsearch) 介绍 Elasticsearch是一个分布式的RESTful搜索和分析引擎,能够解决越来越多的用例. Elasticse ...
- Js中window.location.href和window.location.replace的区别
href相当于打开一个新页面,replace相当于替换当前页面:这里打开页面都是针对历史记录来说,在页面上看完全相同,只是浏览器的history表现不同如果在1.html中点击链接到2.html,然后 ...
- Ubuntu下批量使用Tecplot的preplot命令对数据进行处理
首先把.PLT文件后缀批量修改为.dat rename 's/.PLT$/.dat/' *.PLT 对所有.dat文件批量执行preplot find ./ -name "*.dat&quo ...
- IO流之RandomAccessFile和File
通过学习一些经典案例来复习基础 ------------------------------------------------------------------------------------ ...
- python全栈开发,Day43(引子,协程介绍,Greenlet模块,Gevent模块,Gevent之同步与异步)
昨日内容回顾 I/O模型,面试会问道 I/O操作,不占用CPU,它内部有一个专门的处理I/O模块 print和写log属于I/O操作,它不占用CPU 线程 GIL保证一个进程中的多个线程在同一时刻只有 ...
- SQL Server性能调优--索引
序言 索引的概念 索引是什么 数据库中的索引类似于一本书的目录,在一本书中使用目录可以快速找到你想要的信息,而不需要读完全书.在数据库中,数据库程序使用索引可以快速查询到表中的数据,而不必扫描整个表. ...
- java文件断点上传
1,项目调研 因为需要研究下断点上传的问题.找了很久终于找到一个比较好的项目. 在GoogleCode上面,代码弄下来超级不方便,还是配置hosts才好,把代码重新上传到了github上面. http ...
- [USACO14MAR] 破坏Sabotage(二分答案,分数规划)
题目链接 Solution 去掉中间一段区间 \([l,r]\) 后剩下的平均值可以表示为 : \[\frac{\sum^{n}_{i=1}{v_i}-\sum^{r}_{i=l}{v_i}}{n-( ...
- Elven Postman
Elven Postman Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)T ...
- ConcurrentModificationException异常
介绍一个我今天在开发中遇到的异常:ConcurrentModificationException异常,当然它是一个非受检的异常,也就是运行时异常. 当我们在遍历集合对象的时候,不能够将集合删除.最佳实 ...