[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/ByteVortex/JavaGuide/main/docs/tools/git/git-intro.md [Back]  [Original]

---
title:  Git 
category: 
tag:
  - Git
---

## 

### 

 

### 



### 

  



![](https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/2019-3/.png)

### 

 Centralized Version Control Systems CVCS



![](https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/2019-3/.png)



- **** 
- **** 

### 

Distributed Version Control System DVCS Git 

  

![](https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/2019-3/.png)



 Git 

##  Git

### Git 

Linux  BitKeeper  BitKeeper  Linux  Linux  BitKeeper  Linux  Linux  Linus Torvalds BitKeeper 

### Git 

Git 

 Git ****

**Git **

CVSSubversionPerforceBazaar ****

 (Delta)

![](https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/2019-3deltas.png)

****



****



Git  Git   Git  Git  Git  ****

![](https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/2019-3snapshots.png)

### Git 

Git 

1. **committed**
2. **modified**
3. **staged**

 Git **Git (.git directory)****(Working Directory)**  **(Staging Area)** 

![](https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/2019-3areas.png)

** Git **

1. 
2. 
3.  Git 

## Git 

###  Git 

 Git 

1. :  `git init` , `.git` 
2.  Git : `git clone [url]` : `git clone [url] directoryname`

### 

1. **** : `git status`
2. ****`git add filename` ()`git add *`()`git add *.txt` .txt 
3. ****`.gitignore` 
4. **:** `git commit -m ""`  `git status`   `git commit`
5. **** : `git commit -a -m ""` `git commit`  `-a` Git  `git add` 
6. **** `git rm filename` 
7. **** `git mv README.md README`(`mv README.md README``git rm README.md``git add README` )

###  Git 

 Git 

    
    
    
    
     "git log" 

 Git 

### 

- `git remote add origin ` , Github `git remote add origin https://github.com/Snailclimb/test.git`
- `git push origin master` ( _master_ )

  

### 

-  test  test1`git remote rename test test1`
-  test1:`git remote rm test1`

### 

  `git log` `git log` 

****



```shell
git log --author=bob
```

### 

  `--amend` 

```shell
git commit --amend
```



```shell
git reset filename
```

:

```shell
git checkout -- filename
```



```shell
git fetch origin
git reset --hard origin/master
```

### 

_master_ 

 bug 

 test 

```shell
git branch test
```

 testGit  Git 

```shell
git checkout test
```

![](https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/2019-3.png)

()

```shell
git checkout -b feature_x
```



```shell
git checkout master
```

()

```shell
 git merge test
```



```shell
git branch -d feature_x
```



```shell
git push origin
```

## 

****

[issue729](https://github.com/Snailclimb/JavaGuide/issues/729)Learn Git Branching https://oschina.gitee.io/learn-git-branching/  git 

****

- [Git (1.5W  40 ) ](https://www.cnblogs.com/anding/p/16987769.html)
- [Git - ](https://rogerdudler.github.io/git-guide/index.zh.html) Git 
- [ Git](https://marklodato.github.io/visual-git-guide/index-zh-cn.html) Git  git 
- [ Git ](https://backlog.com/git-tutorial/cn/intro/intro1_1.html) 
- [Pro Git book](https://git-scm.com/book/zh/v2)   Git 

Web Proxy Viewer  |  New URL  |  Original Page