Git Bash 常用指令
1. 关于git bash常用指令 推荐博客:
Learn Version Control with Git for Free
2. 常用指令:
git config --global user.name "名字"
git config --global user.email "邮箱"
git status 查看当前状态
git init 初始化本地仓库
git add “filename”
git commit –m “注释”
git log
git branch 查看分支
git branch a 创建分支a
git checkout a 切换到a分支
git merge a 将分支a合并到当前分支
git branch –d a 删除分支a
git branch –D a 强制删除分支a
git push origin master
git pull origin master 把远端origin的master分支的最新版本拉取到本地,自动merge
git fetch origin master 把远端origin的master分支的最新版本拉取到本地,不merge,较安全
git clone https://github.com/... 克隆远程仓库
git remote add origin https://github.com/... 关联远程仓库
git reset --hard 版本号 回滚到特定版本
git push -f origin master 将本地的当前版本强制提交到远程仓库中
注意:在我们向远程仓库提交代码的时候,一定要先进行pull操作,再进行push操作,防止本地仓库与远程仓库不同步导致冲突的问题。
These are common Git commands used in various situations:
start a working area (see also: git help tutorial) |
|
clone |
Clone a repository into a new directory |
init |
Create an empty Git repository or reinitialize an existing one |
work on the current change (see also: git help everyday) |
|
add |
Add file contents to the index |
mv |
Move or rename a file, a directory, or a symlink |
reset |
Reset current HEAD to the specified state |
rm |
Remove files from the working tree and from the index |
examine the history and state (see also: git help revisions) |
|
bisect |
Use binary search to find the commit that introduced a bug |
grep |
Print lines matching a pattern |
log |
Show commit logs |
show |
Show various types of objects |
status |
Show the working tree status |
grow, mark and tweak your common history |
|
branch |
List, create, or delete branches |
checkout |
Switch branches or restore working tree files |
commit |
Record changes to the repository |
diff |
Show changes between commits, commit and working tree, etc |
merge |
Join two or more development histories together |
rebase |
Reapply commits on top of another base tip |
tag |
Create, list, delete or verify a tag object signed with GPG |
collaborate (see also: git help workflows) |
|
fetch |
Download objects and refs from another repository |
pull |
Fetch from and integrate with another repository or a local branch |
push |
Update remote refs along with associated objects |
Git Bash 常用指令的更多相关文章
- git/github常用指令、入门
git的基本常用指令: 1.cd:切换路径 2.mkdir:进入文件夹目录 3.pwd:显示当前目录的路径 4.git init:把当前的目录变成可以管理的git仓库,生成隐藏.git文件 5.git ...
- git bash 常用命令
1. cd : 切换到哪个目录下, 如 cd e:\fff 切换 E 盘下面的fff 目录. 当我们用cd 进入文件夹时,我们可以使用 通配符*, cd f*, 如果E盘下只有一个f开头的文件 ...
- Git基本常用指令
开发十年,就只剩下这套架构体系了! >>> Git基本常用命令如下: mkdir: XX (创建一个空目录 XX指目录名) pwd: 显示当前目 ...
- git bash 常用操作文件命令行
1, cd : change directory的简写,改变目录的意思,就是切换到哪个目录下, 如 cd e:\fff 切换 E 盘下面的fff 目录. 当我们用cd 进入文件夹时,我们可以使用 通配 ...
- git Bash常用命令
1.Construct ssh key (If you want to commit to git server via THIS COMPUTER) git config --global user ...
- git之常用指令
参考:Git教程 - 廖雪峰的官方网站 1.git //linux上检测是否安装git 2.sudo apt-get install git //linux上安装git 3.git config - ...
- git的常用指令(一)
1. 查看git远程的所有分支 git branch -a 2.查看本地已有的分支 git branch 3.本地检出一个新的分支并推送到远程仓库 一).创建本地分支 git checkout -b ...
- bash常用指令(未完)
#号注释1.man 2.cd 3.clear 4.alias 命令别名设置 区别命令别名和变量的区别,别名可以直接执行,本质是一个函数的索引 5.grep 查找字符串 grep [-acinv] [- ...
- git的常用指令(二) git add -A 、git add . 和 git add -u
git add . :他会监控工作区的状态树,使用它会把工作时的所有变化提交到暂存区,包括文件内容修改(modified)以及新文件(new),但不包括被删除的文件. git add -u :他仅监控 ...
随机推荐
- (水题)洛谷 - P1014 - Cantor表
https://www.luogu.org/problemnew/show/P1014 很显然同一对角线的和是相等的.我们求出前缀和然后二分. 最后注意奇偶的顺序是相反的. #include<b ...
- bzoj 3704: 昊昊的机油之GRST【贪心+脑洞】
脑洞题大概 首先处理出每个位置需要操作的次数c,假设第一次达到目标就不能再走,这样的操作次数是c差分后值的正数和,就想成分治每一段然后同减最小值然后从0处断开 然后考虑能一圈一圈走的情况,连续一段多走 ...
- Mr.Jin系统发布报告——WIN7 WIN8双系统下的学习模式系统
Mr.Jin系统发布报告 本文由Mr.Jin原创发表于博客园.CSDN论坛 http://www.cnblogs.com/CHPowerljp-IT/p/3463850.html ...
- js和jquery给iframe src赋值的3种方法
js和jquery给iframe src赋值的3种方法 网页使用iframe嵌入网页时,有时候需要动态处理src的值,而不是写死的,所以我们需要知道如何给iframe src赋值,通常是使用js或 ...
- RobotFramework自动化测试框架(1)- RobotFramework简介
对于RobotFramework自动化测试框架,我这里会从三个单元进行阐述,希望能对你有帮助. RobotFramework简介 RobotFramework是什么? Robotframework 是 ...
- SpringCloud开发学习总结(七)—— 声明式服务调用Feign(三)
Feign中的Ribbon配置 由于Spring Cloud Feign的客户端负载均衡是通过Spring Cloud Ribbon实现的,所以我们可以直接通过配置Ribbon客户端的方式来自定义各个 ...
- jquery 选择器包含特殊字符
选择器包含 : .# ( ] 等等 比如 <div id="id#a"></div> <div id="id[1]">< ...
- Spring-bean(一)
配置形式:基于xml文件的方式:基于注解的方式 Bean的配置方式:通过全类名(反射),通过工厂方法(静态工厂方法&实例工厂方法),FactoryBean 依赖注入的方式:属性注入,构造器注入 ...
- poj1190 生日蛋糕
题意: 要制作一个体积为Nπ的M层生日蛋糕,每层都是一个圆柱体. 设从下往上数第i(1 <= i <= M)层蛋糕是半径为Ri, 高度为Hi的圆柱.当i < M时,要求Ri > ...
- 搭建SSM框架(聚合项目)
parents 父工程 pom base用户权限 jar wms业务 jar app帮助管理 war1. parents的pom.xml文件 1.1 maven servlet3.1.0 1.2 ...