Skip to content

Instantly share code, notes, and snippets.

View mk100120's full-sized avatar
🌞

kenny mk100120

🌞
  • sap
  • shanghai
View GitHub Profile
@mk100120
mk100120 / git-reset-revert
Created April 10, 2018 03:30
git-reset-revert
git diff --cached 比较暂存区和HEAD的文件差异
git log --stat 查看提交历史记录, 其中--stat会显示文件的历史变化
git diff 比较差异
git log --pretty = oneline
git status -s 精简指令
<?xml version="1.0" encoding="UTF-8"?>
<!-- log4j 转 slf4j 工具 https://logback.qos.ch/translator/-->
<!-- For assistance related to logback-translator or configuration -->
<!-- files in general, please contact the logback user mailing list -->
<!-- at http://www.qos.ch/mailman/listinfo/logback-user -->
<!-- -->
<!-- For professional support please see -->
<!-- http://www.qos.ch/shop/products/professionalSupport -->
<!-- -->
<configuration>
1. git branch -vv //查看本地分支关联(跟踪)的远程分支之间的对应关系
git branch -u origin/demo //建立当前本地分支与远程分支的映射关系,建立关系以后才能 pull和push
git branch --set-upstream-to origin/demo //同上
git branch --unset-upsteam //撤销当前本地分支与远程分支的映射关系
2. git push <远程主机名> <本地分支名>:<远程分支名> //git push的完成操作命令, 其中当远程分支跟本地分支有追踪关系时,远程分支可以省略,
所以git push origin master中的 master 指的是本地的master分支
3. git remote update <远程仓库名> // 用于更新远程仓库的所有分支信息
### Mac版:
1.全局搜索:double `shift`