git必備命令

git基本操做git

撤銷本地全部修改 和服務器 指定版本號保持一致,若是有報紅文件刪除就好。github

git reset --hard 「7b06bcddd096032f1945ebfff5dff2536dde36d5"bash

 查看遠程分支服務器

git branch -rcurl

查看本地分支url

git branch -a操作系統

 

git config --global user.name "zhangyue"orm

 

/ect/gitconfig --systemit

~/.gitconfig --globalzsh

.git/config --local

git config --global user.name ''

git connfig --global user.email ''

 

 

 

control+a

control+e

光標箭頭移動收尾

若是一我的被舉報屢次

 

git rm :

1.刪除了一個文件

2.將被刪除的文件拉入暫存區(stage,index)

若想恢復被刪除的文件,須要進行兩個動做:

a.git reset HEAD test2.text 將刪除的文件從暫存區恢復到工做區

b.git checkout -- test2.txt 將工做區中的修改丟棄掉。

 

rm:

使用操做系統講test2.txt刪除掉,這時,被刪除的文件沒有被加入到暫存區。

綠色是暫存區。

 

 

➜  mygit git:(master) git log

➜  mygit git:(master) git log -n 3

➜  mygit git:(master) git log -- pretty=oneline

➜  mygit git:(master) git log --pretty=oneline 

➜  mygit git:(master) git log --pretty=format:"%h-%an,%ar:%s"

 

bash

zsh

 

on my zsh.

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)」

: set number

control+F 下一頁

control + b 上一頁

shift+g 最後一行

dd 刪除一行

touch test.txt 新建文件

cat test.txt 查

cp text.txt test2.txt

mv test2.txt test3.tx

man  rm  查看命令方式

相關文章
相關標籤/搜索