forked from arkingc/note
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
> 内容源自[廖雪峰的Git教程](https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000) | ||
* [一.git配置](一git配置) | ||
- [1.配置git用户名和邮箱](1配置git用户名和邮箱) | ||
* [二.仓库](二仓库) | ||
- [1.创建git仓库](1创建git仓库) | ||
- [2.查看仓库状态](2查看仓库状态) | ||
- [3.远程仓库](3远程仓库) | ||
|
||
<br> | ||
<br> | ||
|
||
# 一.git配置 | ||
|
||
优先级:`--local > --global > --system` | ||
|
||
> 用了`--global`这个参数,表示你这台机器上所有的Git仓库都会使用这个配置 | ||
### 1.配置git用户名和邮箱 | ||
|
||
```bash | ||
git config --global user.name # 查看 | ||
git config --global user.name 用户名 # 修改 | ||
git config --global user.email # 查看 | ||
git config --global user.email 邮箱 # 修改 | ||
``` | ||
|
||
|
||
|
||
# 二.仓库 | ||
|
||
### 1.创建git仓库 | ||
|
||
```bash | ||
git init 仓库名 #创建一个git仓库 | ||
git init #将一个项目转化为使用git管理(创建.git目录) | ||
``` | ||
|
||
示例: | ||
|
||
<div align="center"> <img src="../pic/git-1.png"/> </div> | ||
|
||
目录结构: | ||
|
||
```bash | ||
project | ||
|------.git | ||
|--------branches | ||
|--------config #项目的配置文件 | ||
|--------description | ||
|--------HEAD | ||
|--------hooks | ||
|--------info | ||
|--------objects | ||
|--------refs | ||
``` | ||
|
||
### 2.查看仓库状态 | ||
|
||
```bash | ||
git status | ||
``` | ||
|
||
### 3.远程仓库 | ||
|
||
> 最早,肯定只有一台机器有一个原始版本库,此后,别的机器可以“克隆”这个原始版本库,而且每台机器的版本库其实都是一样的,并没有主次之分 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
## Linux管理 | ||
|
||
* [Linux常用命令](Linux/Linux常用命令.md) | ||
* 版本控制:[git](Linux/git.md) | ||
|
||
## C++ | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.