markdown 有用的Git命令

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 有用的Git命令相关的知识,希望对你有一定的参考价值。

## First of all install git on ubunut 
```bash
sudo apt-get install git 
```
### Check git version
```bash
gti --version
```
### Project Initialize 
```bash
git init
```
### Check status
```bash
git status 
```
### Add single file
```bash
git add <filename>
```
### Track all files
```bash
git add .(dot)
```
### Git config 
```bash
git config --global user.email "example@gmail.com"
git config --global user.name "username"
```
### Commit files 
```bash
git add -m "message"
```
### Check commit 
```bash
git log
```
### Show commit message and id in Oneline 
```bash
git log --oneline
```
### Check commit id 
```bash
git show <commit id>
```
### Git diff
```bash
git diff
```
### Difference between two files
```bash
git diff --staged
```
### Difference between two commits 
```bash
git diff <commit id one> <commit id two>
```
### Remove files
```bash
git rm <filename>
```
### Git Reset 
```bash
gti reset HEAD <filename>
```

以上是关于markdown 有用的Git命令的主要内容,如果未能解决你的问题,请参考以下文章

markdown Git有用的命令

markdown Git - 有用的命令

markdown 有用的Git命令

markdown 有用的Git命令

markdown 有用的Git命令

markdown 有用的git命令