新增:《内网CentOS服务器设置网络代理》
This commit is contained in:
@@ -40,7 +40,7 @@ tags:
|
||||
|
||||
1. 克隆后端项目仓库到本地(笔者没有在 git bash 中操作,而是在 cmd 中进行的)
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git clone https://gitee.com/Charles7c/eladminx.git
|
||||
cd eladminx
|
||||
```
|
||||
@@ -49,7 +49,7 @@ tags:
|
||||
|
||||
2. 将前端仓库作为后端仓库的远程仓库,起别名为 frontend(这个随便起)
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git remote add -f frontend https://gitee.com/Charles7c/eladminx-web.git
|
||||
```
|
||||
|
||||
@@ -57,7 +57,7 @@ tags:
|
||||
|
||||
3. 将前端仓库的 master 分支(自己选择哪个分支)合并到后端仓库
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git merge --strategy ours --no-commit frontend/master
|
||||
```
|
||||
|
||||
@@ -71,7 +71,7 @@ tags:
|
||||
|
||||
这是因为后端仓库的本地分支历史记录和前端仓库的历史记录不匹配,人家 Git 怀疑你是不是合并错了,但咱们知道就是要合并,写个声明 “表明出事儿与人家无关”就可以了。
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git merge --strategy ours --allow-unrelated-histories --no-commit frontend/master
|
||||
```
|
||||
|
||||
@@ -79,20 +79,20 @@ tags:
|
||||
|
||||
4. 将前端仓库的 master 分支内容放到在后端仓库内刚建好的 eladminx-web 文件夹中
|
||||
|
||||
```bash
|
||||
```sh
|
||||
mkdir eladminx-web
|
||||
git read-tree --prefix=eladminx-web/ -u frontend/master
|
||||
```
|
||||
|
||||
5. 提交刚才的修改(毕竟你刚才又合并又创建文件夹的,肯定要提交修改啊)
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git commit -m "迁移前端项目仓库,与后端项目仓库合并"
|
||||
```
|
||||
|
||||
6. 最后将本地的修改强制推送到远程仓库即可
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git push --force
|
||||
```
|
||||
|
||||
|
@@ -22,13 +22,13 @@ tags:
|
||||
|
||||
1. 修改最后一次提交的作者和邮箱信息
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git commit --amend --author="Charles7c <charles7c@126.com>"
|
||||
```
|
||||
|
||||
2. 最后将本地的修改强制推送到远程仓库即可(如果你没推送到远程仓库,这步就不需要执行了)
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git push --force
|
||||
```
|
||||
|
||||
@@ -36,7 +36,7 @@ tags:
|
||||
|
||||
**C:** 另外说一下,如果你要修改最后一次提交记录的 commit message,执行下面的命令就可以了。
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git commit --amend -m "要修改为的提交信息"
|
||||
```
|
||||
|
||||
|
@@ -22,7 +22,7 @@ tags:
|
||||
|
||||
2. 复制下方脚本内容到脚本文件中,然后编辑替换好错误邮箱、正确作者和邮箱(如果是在 cmd 中执行,#!/bin/sh 就替换为 #!/bin/bat)
|
||||
|
||||
```shell
|
||||
```sh
|
||||
#!/bin/sh
|
||||
|
||||
git filter-branch --env-filter '
|
||||
|
@@ -29,7 +29,7 @@ tags:
|
||||
|
||||
我们先一起回忆下全局配置用户名和邮箱的方法,在任意 Git 仓库里进行如下配置即可:
|
||||
|
||||
```shell
|
||||
```sh
|
||||
# 全局配置用户名
|
||||
git config --global user.name "Charles7c"
|
||||
# 全局配置邮箱
|
||||
@@ -40,7 +40,7 @@ git config --global user.email "charles7c@126.com"
|
||||
|
||||
局部配置的方法也是非常简单,首先进入指定的 Git 仓库,然后进行如下配置即可:
|
||||
|
||||
```shell
|
||||
```sh
|
||||
# 进入指定 Git 仓库
|
||||
cd HelloWorld
|
||||
# 局部配置用户名
|
||||
@@ -55,7 +55,7 @@ git config user.email "charles7c@126.com"
|
||||
当然了,你也可以去其他没进行局部配置的仓库看看,看看它们的用户名和邮箱有没有受到影响。
|
||||
:::
|
||||
|
||||
```shell
|
||||
```sh
|
||||
# 查看所在 Git 仓库配置的用户名
|
||||
git config user.name
|
||||
# 查看所在 Git 仓库配置的邮箱
|
||||
|
Reference in New Issue
Block a user