1.git init
git init
2.git checkout
#回退到git add之前的状态,把f.txt文件在工作区的修改全部撤销 git checkout -- f.txt
3.git add
#添加文件到暂存区 git add f1.txt git add f2.txt f3.txt
4.git rm
git rm --cache f.txt #将f.txt从暂存区删除 git rm f.txt #将暂存区及本地的文件删除
5.git commit
#把暂存区的所有内容提交到当前分支 git commit -m "commit 3 files to repo"
6.git reset
git reset --hard HEAD^ #回退到上一次提交 git reset --hard HEAD~3 #回退到三次提交前 git reset --hard CommitID #回退到指定提交记录
7.查看本地仓库状态
git status
8.git diff
git diff f.txt #查看工作区与暂存区中f.txt文件的区别 git diff --cached f.txt #查看暂存区与版本库中f.txt文件的区别 git diff --staged #查看暂存区与版本库中f.txt文件的区别 git diff HEAD -- f.txt #查看工作区与版本库中f.txt文件的区别 git diff dev master git diff dev..master #直接将两个分支上最新的提交做比较 git diff dev...master #将两个分支上共同修改的部分做比较 git diff HEAD^ HEAD #比较两次提交的差异 git diff commit1 commit2 #比较连两个版本间的差异
9.git log
git log #显示所有提交记录 git log -n #显示最近N条提交记录 git log --stat -n #显示每次提交的行数变更统计,并显示最近N条提交记录 git log -p -n git log --pretty=oneline #只显示hash值和提交说明 git log --graph #显示每个提交所在的分支及其分化衍合情况 git log --pretty=format:"Options" #控制显示的记录格式 git log --pretty=oneline *f.txt #指定项目路径下的所有以f.txt结尾的文件的提交历史 #指定日期、关键字、作者 git log --since=2.days git log --author=Rule git log --grep=iPush git log --committer=Rule
10.git reflog
#可以查看所有分支的所有操作记录 git reflog
11.git blame
git blame filename #显示一个文件的所有需改记录 git blame -L N,+N filename
12.git rebase
#基本功能同merge,与merge区别是,merge后histroy log显示合并记录,rebase不显示合并记录 git rebase
相关推荐
常用git命令,管理代码仓库的一些常用命令。
git command1
As Windows users commonly expect graphical user interfaces, Git for Windows also provides the Git GUI, a powerful alternative to Git BASH, offering a graphical version of just about every Git command ...
TWU作业此存储库是为2020TWU-homework和git command-ex创建的
Git-CommandLine
To understand and follow the recipes included in this book, basic knowledge of Git command-line code is mandatory. Table of Contents Chapter 1. Navigating Git Chapter 2. Configuration Chapter 3. ...
Git-command-line 是命令行 Git 的包装器,所以你必须在你的 linux/mac 机器上安装 git(它还没有在 windows 中测试过)。 常见的语法是: var GitCommandLine = require ( 'git-command-line' ) ; var Git = new...
Git-2.17.0-64-bit.win64 windows64位下GIT 工具 GIT bash、Git GUI、Git Command
git cheetsheet, fast git command reference
一个简单的插件,可让您将保管库备份到远程git存储库(例如GitHub上的私人存储库)。该插件假定您已经在本地初始化了现有的git存储库,并且已设置凭据。 关于使用git备份保险库的好处,我建议阅读这篇。您也可以在...
function gitCommand ( arg : String , // a string argument to pass as the main param to git params : String [ ] , // git command options nodeSpawnOptions : Object = { cwd : process
Git Command Line Package failed please correct the following problems to ensure full product functionality to learn more ,you can review the list of common issues and workarounds or examine the log...
Download and install the Git command line extension. Once downloaded and installed, set up Git LFS for your user account by running: git lfs install You only need to run this once per user account. ...
$ git clippy [git command] $ git clippit [git command] 要求 苹果系统 $ brew install cowsay 拱 $ pacman -Syu cowsay Debian / Ubuntu $ apt-get install cowsay 安装 简易模式 $ curl -L ...
语言:English 使用此扩展,您可以学习或修订git命令 Command Explorer是Google Chrome扩展程序。 查找所需的正确命令,而无需在网络上浏览。
6.选中 Git GUI Here 右键新建(项),并重命名为command,command的值设置为 D:\Program Files\Git\cmd\git-gui.exe --working-dir %v,其中--working-dir和git-gui.exe之间有空格,--working-dir和%v之间也有空格 ...
Meson:registered:是一个创建最佳的下一代构建系统的项目。 状态 依存关系 (3.6版或更高版本) (版本1.8.2或更高版本) 从源安装 Meson在上,因此可以与pip3 install meson 。 使用pip进行安装的确切命令类型...
git_command 之前保存在本地的git命令之前
Used if you need to pass the manifest revision to a locally executed git command. REPO_RREV is the name of the revision from the manifest, exactly as written in the manifest. Options: -c: command ...
编码猫Git CommandLine命令: git init初始化本地git仓库git remote add <name> 仓库git remote add <name> 仓库git remote add <name> 添加一个远程仓库 git remote -v显示包括链接的遥控器git remote show 显示-v...