github命令大全
来源:互联网 发布:房卡麻将源码微信 编辑:程序博客网 时间:2024/06/06 23:53
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 namegit clone url//download a project and its entire version history
提交变化版本
git status// list all new of modified files to be committedgit diff//show file differences not yet stagedgit add file//snapshot the file in preparation for versioninggit diff --staged//show file difference between staging and the last file versiongit reset file//unstage the file, but preserve its contentsgit commit -m "description message"
群组版本控制
git branch//list all local branches in the current resporitygit branch branch-name//create a new branchgit checkout branch-name//switch to the specific branch and update the working directorygit merge branch//combine the specified branch's history into the current branchgit branch -d branch-name//delete the specified branch
重构文件名
git rm [file]//delete the file from the working directory and stage the deletiongit rm --cached [file]//remove the file from version control but pressure the file locallygit mv [file-origin] [file-renamed]//change the file name and prepare it for commit
排除版本控制
*.logbuild/temp-*
以.log为结尾的文件都不会被进行版本控制
git ls-files --other --ignored --exclude-standard//list all ignored files in the project
git stash//temprarily store all modified tracked filesgit stash pop//restore the most recently stashed filesgit stash list //list all stashed changesetsgit stash drop//discard the most recently stashed changeset
git log//list version history for the current branchgit log --follow [file]list version history for a filegit diff [first-branch]...[second-branch]//show content differences between two branchesgit showw [commit]//output metadata and content change of the specified commit
git reset [commit]//undo all commits after[commit],preserve changes locallygit reset --hard [commit]//discard all history and changes back to the specified commit
git fetch [bookmark]//download all history from the respority bookmarkgit merge [bookmark]
0 0
- github命令大全
- github命令大全
- github命令大全
- github命令大全
- GitHub 教程(命令大全)不断补充完善。。。
- github命令
- github命令
- github命令
- github命令
- github命令
- android github框架大全
- 工具大全github地址
- iOS gitHub三方库大全
- Github常用命令大全
- github markdown语法大全
- 命令大全
- 命令大全
- 命令大全
- 数组中和最大的递增子序列
- java类集
- Sum Problem
- vs2013+qt5.5中显示控制台
- 九度OJ 1158:买房子 (基础题)
- github命令大全
- php反射例子
- Linux下面给用户添加sudo权限
- 升级mac 系统 10.11之后cocoapods出现问题
- UFT使用VBS关闭已打开的应用程序process
- ——黑马程序员——C语言基础--printf函数和scanf函数
- Android五大布局方式——相对布局(RelativeLayout)属性详解
- linux命令
- XMPP客户端库Smack 4.1.4版官方开发文档之二