Git 部分操作

 

 

git config --list 
可以查看配置的一些东西
 

开发时,对于本地的项目中修改不做保存操作(或代码改崩),可以用到Git pull的强制覆盖,具体代码如下:

git fetch --all
git reset --hard origin/master
git pull //可以省略

git fetch 指令是下载远程仓库最新内容,不做合并 
git reset 指令把HEAD指向master最新版本

 

git config --global user.name "Your Name"
git config --global user.email you@example.com

全局的通过vim ~/.gitconfig来查看

 

git config user.name "Your Name"
git config user.email you@example.com

局部的通过当前路径下的 .git/config文件来查看

 


config 配置指令

git config

config 配置有system级别 global(用户级别) 和local(当前仓库)三个 设置先从system-》global-》local  底层配置会覆盖顶层配置 分别使用--system/global/local 可以定位到配置文件

查看系统config

git config --system --list

 

查看当前用户(global)配置

git config --global  --list


查看当前仓库配置信息

git config --local  --list

 

 

 


a

 

posted @ 2019-01-05 16:52  念槐聚  阅读(117)  评论(0)    收藏  举报