1. 关于git bash常用指令 推荐博客:

史上最简单的 GitHub 教程 

猴子都能懂的GIT入门

Learn Version Control with Git for Free

Git Documentation 

Git Book

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 常用指令的更多相关文章

  1. git/github常用指令、入门

    git的基本常用指令: 1.cd:切换路径 2.mkdir:进入文件夹目录 3.pwd:显示当前目录的路径 4.git init:把当前的目录变成可以管理的git仓库,生成隐藏.git文件 5.git ...

  2. git bash 常用命令

    1.   cd : 切换到哪个目录下, 如 cd e:\fff  切换 E 盘下面的fff 目录. 当我们用cd 进入文件夹时,我们可以使用 通配符*, cd f*,  如果E盘下只有一个f开头的文件 ...

  3. Git基本常用指令

    开发十年,就只剩下这套架构体系了! >>>   Git基本常用命令如下: mkdir:         XX (创建一个空目录 XX指目录名) pwd:          显示当前目 ...

  4. git bash 常用操作文件命令行

    1, cd : change directory的简写,改变目录的意思,就是切换到哪个目录下, 如 cd e:\fff 切换 E 盘下面的fff 目录. 当我们用cd 进入文件夹时,我们可以使用 通配 ...

  5. git Bash常用命令

    1.Construct ssh key (If you want to commit to git server via THIS COMPUTER) git config --global user ...

  6. git之常用指令

    参考:Git教程 - 廖雪峰的官方网站 1.git  //linux上检测是否安装git 2.sudo apt-get install git //linux上安装git 3.git config - ...

  7. git的常用指令(一)

    1. 查看git远程的所有分支 git branch -a 2.查看本地已有的分支 git branch 3.本地检出一个新的分支并推送到远程仓库 一).创建本地分支 git checkout -b ...

  8. bash常用指令(未完)

    #号注释1.man 2.cd 3.clear 4.alias 命令别名设置 区别命令别名和变量的区别,别名可以直接执行,本质是一个函数的索引 5.grep 查找字符串 grep [-acinv] [- ...

  9. git的常用指令(二) git add -A 、git add . 和 git add -u

    git add . :他会监控工作区的状态树,使用它会把工作时的所有变化提交到暂存区,包括文件内容修改(modified)以及新文件(new),但不包括被删除的文件. git add -u :他仅监控 ...

随机推荐

  1. PKI体系下的 SSL TLS HTTPS 详解

    背景: SSL(Secure Socket Layer 安全套接层)是一个加密函数库,它可以将应用层上所有明文传输的数据,通过调用SSL库,即可摇身一变成为安全通信连接,SSL最初是由网景公司(Net ...

  2. Linux下备份MySQL数据库的Shell脚本

    数据库每天都想备份,手动备份太麻烦而又容易忘记,所以写了一个自动备份MySQL数据库的脚本,加入定时计划中,每天自运运行. 创建Shell脚本代码如下,命名为mysql_dump.sh #!/bin/ ...

  3. 关于能ping通服务器但ssh登陆不上的问题

    一般来说能ping通服务器说明网没问题 这是可以查看一下防火墙的设置和ip的屏蔽设置 /etc/init.d/iptables status  查看防火墙状态 vim /etc/hosts.allow ...

  4. php url地址栏传中文乱码解决方法集合

     php地址栏传中文$_GET下来后乱码,urlencode和urldecode,iconv,base64_encode等方法,整理基本是常用的了. php地址栏传中文$_GET下来后乱码,urlen ...

  5. P2667 超级质数

    https://www.luogu.org/problem/show?pid=2667 题目背景 背景就是描述,描述就是背景...... 题目描述 一个质数如果从个位开始,依次去掉一位数字,两位数字, ...

  6. Activity的创建、生命周期

    Activity是Android四大组件之一.一个Activity负责管理一个界面. 创建一个Activity: New -> Activity -> 选择要创建的Activity类型(一 ...

  7. 【学习笔记】深入理解js原型和闭包(18)——补充:上下文环境和作用域的关系

    本系列用了大量的篇幅讲解了上下文环境和作用域,有些人反映这两个是一回儿事.本文就用一个小例子来说明一下,作用域和上下文环境绝对不是一回事儿. 再说明之前,咱们先用简单的语言来概括一下这两个的区别. 0 ...

  8. 【学习笔记】比特(bit)、字,字节(B)存储单位之间的关系+其与操作系统位数的关系+不同编译器编译方式下数据类型的表示范围

    1.在表示网络传输速度中与表示存储单位的不同: 表示存储单位时:1kB=1024B,但在网络中表示传输速度是1KB=1000B 2.下面介绍表示存储单位时的关系及其与操作系统位数的关系: 1B=8bi ...

  9. 一个Java编写的小玩意儿---多人在线聊天工具

    这个在线聊天工具小项目使用JAVA编写,用JAVA来做图形界面本来就是出了名的低效和丑陋.不过这不是重点.写这个小项目的目的在于串一串J2SE的知识,把当时写这个项目的时候的思路梳理一下.时间有点久了 ...

  10. SQLite – GROUP BY

    SQLite - GROUP BY SQLite GROUP BY子句中使用与SELECT语句的合作安排相同的数据组. 在GROUP BY子句之前一个SELECT语句的WHERE子句,先于ORDER ...