-
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
1 parent
1ff7739
commit 0bcc8df
Showing
25 changed files
with
140 additions
and
61 deletions.
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,5 @@ | ||
--- | ||
title: Git- 基本操作 | ||
order : 1 | ||
--- | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Git- 忽略跟踪的文件 | ||
order : 1 | ||
order : 2 | ||
--- | ||
|
||
## 忽略规则 | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Git-多仓库工具 Repo | ||
order : 2 | ||
order : 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Git-规范 Git 提交信息并生成日志 | ||
order : 3 | ||
order : 4 | ||
tag: | ||
- husky | ||
--- | ||
|
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
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 |
---|---|---|
|
@@ -5,25 +5,54 @@ tag: | |
- 踩坑记录 | ||
--- | ||
|
||
## 使用场景 | ||
## 问题详情 | ||
|
||
在很多情况下,常常要对多个 github 账号进行切换。比如,自己的、公司的、小号。 | ||
有时候要对多个 github 账号进行切换。比如,自己的、公司的、小号。 | ||
|
||
## 切换步骤 | ||
## 解决思路 | ||
### 前置准备 | ||
|
||
1. 创建 ssh key | ||
| 账户名 | 邮箱 | | ||
|------------|--------------------------| | ||
| username-1 | [email protected] | | ||
| username-n | [email protected] | | ||
|
||
2. 将 public key 上传至服务器(名字随意即可) | ||
|
||
![github add ssh key](./assets/github-add-ssh-key.png) | ||
<div id="section1"> | ||
</div> | ||
|
||
3. 在 `~/.ssh/` 目录下创建 config 文件 | ||
### 1. 生成其中一个账户密钥 | ||
>* GitBash或者IDE中输入 | ||
```bash | ||
git config --global user.name 账户名 | ||
``` | ||
>* 无错误后继续输入 | ||
```bash | ||
git config --global user.name 你的邮箱 | ||
``` | ||
>别傻到直接拷贝,替换中文内容成你对应的账户名、邮箱 | ||
### 2. 创建 ssh key | ||
|
||
>* 打开CMD输入以下内容 | ||
```bash | ||
"ssh-keygen -t rsa -C "你的邮箱" | ||
``` | ||
>默认在你的`C:\Users\root/.ssh/`生成id_rsa和id_rsa.pub两个文件,用记事本打开id_rsa.pub | ||
![SSH-KEY.png](assets%2FSSHKEY.png) | ||
### 3. 拷贝上传至服务器(名字随意即可) | ||
![uploadSSH-KEY2Github.png](assets%2Fsshkeynew.png) | ||
### 4. 其他账号重复[1-3](#section1)在 `~/.ssh/` 目录下创建 config 文件 | ||
```bash | ||
vim ~/.ssh/config | ||
``` | ||
4. config 内容 | ||
### 5. 修改config 内容(config文件的规则很简单——在每个Host寻找对应的秘钥。) | ||
``` bash | ||
# 正常使用的 rsa | ||
|
@@ -37,15 +66,70 @@ tag: | |
IdentityFile ~/.ssh/id_rsa_new | ||
``` | ||
5. clone 项目 | ||
### 6. 测试 | ||
``` bash | ||
ssh -T aa.github.com | ||
``` | ||
> 如果出现 | ||
`Permission denied (publickey).` | ||
> 说明没有对应的秘钥 | ||
> 如果出现 | ||
`Hi git_xxx! You've successfully authenticated, but GitHub does not provide shell access.` | ||
> 表示配置成功 | ||
### 7. 切换账户 | ||
> 假定我们A账户切换到N账号 | ||
> ```bash | ||
> git config --global user.name n账户名 | ||
> git config --global user.email n账户的邮箱 | ||
> ``` | ||
### 8. clone or add | ||
> clone | ||
```bash | ||
# 原项目地址为 | ||
git clone [email protected]:xxxxxx/xxx.git | ||
git clone 你的远程仓库的ssh地址 | ||
# 修改为 | ||
git clone git@new:xxxxxx/xxx.git | ||
git clone 你的新远程仓库的ssh地址 | ||
``` | ||
> add | ||
```bash | ||
git remote add origin 你的远程仓库的ssh地址 | ||
``` | ||
>如果出现错误 | ||
` fatal: remote origin already exists` | ||
>则按以下顺序输入 | ||
```bash | ||
git remote rm origin | ||
``` | ||
```bash | ||
git remote add origin 你的远程仓库的ssh地址 | ||
``` | ||
> <span style="color:red">什么?你不知道ssh地址怎么来?</span> | ||
![sshurl.png](assets%2Fsshurl.png) | ||
> <span style="color:red">什么?你不知道add和clone是啥?</span> | ||
>我真的快疯掉了..... | ||
* git remote add 用于在已有的本地仓库中添加一个远程仓库的引用。 | ||
* git clone 用于将远程仓库的内容完整地复制到本地,同时会自动创建一个默认的远程引用。 | ||
### 9. push 项目 | ||
>设置好远端后,直接push即可 | ||
6. push 项目 | ||
```bash | ||
git push -u origin master | ||
``` | ||
因为在一开始 clone 的时候已经配置好了,所以 push 时就无需配置了。不过我们还需要 `git config` 修改一下本地的 `user.name` 和 `user.email` 来保证是同一个人修改了, 否则会应用全局的 `config` 设置 | ||
## 参考资料 | ||
如果你阅读本文有点吃力,或者对其中的git操作不太清楚,我强烈建议你看看我写的git基本操作篇。🤦♂️ | ||
[git基本操作](../git/0-gitbase.md) |
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 |
---|---|---|
|
@@ -7,12 +7,16 @@ tag: | |
--- | ||
|
||
## 问题详情 | ||
本着能用一个IDE解决问题的想法,尝试用*Rider*开发前端,结果一开始Push就出问题了。 | ||
1. 远程空仓库已经建立 | ||
![pushtest.png](assets%2Fpushtest.png) | ||
2. 无法推送项目 <br> | ||
本着能用一个IDE来完成各自的想法,尝试用*Rider*开发前端,结果一开始Push就出问题了。 | ||
>1. 远程空仓库已经建立 | ||
![无法推送](assets%2Fpushtest.png) | ||
>2. 无法推送项目 | ||
[email protected]: Permission denied (publickey). fatal: Could not read from remote... | ||
![保存信息](./assets/ssh.png) | ||
|
||
![错误提示](./assets/ssh.png) | ||
|
||
## 参考资料 | ||
|
||
1. [CSDN](https://blog.csdn.net/W_317/article/details/106518894) |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
--- | ||
title: unreal | ||
icon: u | ||
article: false | ||
dir: | ||
order: 2 | ||
category: | ||
- 文档 | ||
- unreal | ||
tag: | ||
- unreal | ||
--- | ||
![uelogo.jpg](assets%2Fuelogo.jpg) | ||
|
||
## 这是一个关于UE的专题 | ||
- [unrealbase](unrealbase/README.md) | ||
|
||
## 概述 | ||
虚幻引擎(英语:Unreal Engine)是一款由Epic Games开发的游戏引擎。 |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.