注解

@LoadBalanced

image.png

LoadBalanced没有@import什么的,只有一个@Qualifier

LoadBalancerAutoConfiguration

在LoadBalancerAutoConfiguration中用了@LoadBalanced

image.png

将所有具有负载均衡标识的RestTemplate类型的Bean注入到集合中

1
2
3
4
5
6
7
8
9
10
11

@Bean

@LoadBalanced

public RestTemplate restTemplate(){

return new RestTemplate();

}

使用一般这样使用

参考

用户名密码

1
2
3
4
5
6
7
8
9

# 查看git 用户名

git config --global user.name

# 查看git email

git config --global user.email

配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

# 查看全局的配置

git config --global -l

# 查看https的代理 直接在后面跟上代理地址就可以设置代理

git config --global https.proxy

# 查看http的代理 直接在后面跟上代理地址就可以设置代理

git config --global http.proxy

# 取消http代理

git config --global --unset http.proxy

# 取消https代理

git config --global --unset https.proxy

# 当连接github的时候使用的ssh的方式

git config --global socket.proxy 127.0.0.1:9981

强制覆盖

1
2
3

git fetch --all && git reset --hard origin/master && git pull

远程分支

  • 查看本地分支
1
2
3

git branch

  • 查看远程分支
1
2
3

git brach -r

  • 查看所有分支
1
2
3

git branch -a

  • 将本地新建的分支与远程分支相关联(在当前分支下输入以下命令)

  • 两种方式

1
2
3
4
5

git branch -u origin/分支名 其中origin/分支名 中分支名 为远程分支名

git branch –-set-upstream-to=origin/分支名 本地分支名

  • 撤销本地分支与远程分支的关系
1
2
3

git branch --unset-upstream

改变远程分支名字

本地分支是可以直接修改名字,但是远程不行,步骤:

  1. 改变本地分支名字

  2. 删除远程分支(当然在此之前要将本地分支和远程分支同步)

  3. 将本地分支推送到 远程分支

  4. 将本地分支和远程分支关联起来

1
2
3
4
5
6
7
8
9

git branch -m oldBranch newBranch

git push --delete origin oldBranch

git push origin newBranch

git branch --set-upstream-to origin/newBranch

回退版本

reset

  • git reset: 回滚到某次提交。

  • git reset --soft: 此次提交之后的修改会被退回到暂存区。

  • git reset --hard 此次提交之后的修改不做任何保留,git status 查看工作区是没有记录的。

revert

  • git revert : 之前的提交仍会保留在 git log 中,而此次撤销会做为一次新的提交。

  • git revert -m :用于对 merge 节点的操作,-m 指定具体某个提交点。

ssh生成

1
2
3

ssh-keygen -t ed25519 -C "your_email@example.com"

如果是比较老的系统不支持,可以使用

1
2
3

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

看到掘金又是让大家写2021自己的感悟,我也来凑凑热闹,回顾一下我的2021。

Read more »
0%