Git常用命令.md

Git常用命令

git 提交

1
2
3
4
5
git clone https://gitee.com/idse666666/bbs.git
git remote -v
git remote rename origin hbq
git commit -m "less test" -a
git push origin hbq_dev:hbq_dev

清除git缓存

1
2
git rm -r --cached .
git add .

Git设置代理

1
2
3
4
5
git config --global http.proxy 'socks://127.0.0.1:1080'
git config --global https.proxy 'socks://127.0.0.1:1080'
git config -l
git config --global --unset http.proxy

Git SSH方式clone

  1. 生成证书,邮箱随意ssh-keygen -t rsa -C "baoqi.hui@qq.com"

  2. 查看公钥cat ~/.ssh/id_rsa.pub

  3. Git平台配置

    image-20221115174736923

git回滚

1
2
3
4
git log
git reset --hard <commit-hash>
#回滚最近
git reset --soft HEAD^

git忽略提交某文件

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
26
27
cd ../hxq-cloud-commons&&git update-index --assume-unchanged /Users/huibaoqi/Documents/project/CloudHXQProject/hxq-cloud-commons/hxq-commons-session/src/main/java/com/hxq/cloud/commons/session/interceptors/LoginUserArgumentResolver.java

cd ../hxq-cloud-service-common&&git update-index --assume-unchanged /Users/huibaoqi/Documents/project/CloudHXQProject/hxq-cloud-service-common/hxq-cloud-service-common-biz/src/main/resources/logback-spring.xml

cd hxq-cloud-service-content&&git update-index --assume-unchanged /Users/huibaoqi/Documents/project/CloudHXQProject/hxq-cloud-service-content/hxq-cloud-service-api/src/main/resources/logback-spring.xml&&cd ..

cd hxq-cloud-service-drug&&git update-index --assume-unchanged /Users/huibaoqi/Documents/project/CloudHXQProject/hxq-cloud-service-drug/hxq-cloud-service-api/src/main/resources/logback-spring.xml

cd hxq-cloud-service-job&&git update-index --assume-unchanged /Users/huibaoqi/Documents/project/CloudHXQProject/hxq-cloud-service-job/src/main/resources/logback-spring.xml

cd hxq-cloud-service-mall&&git update-index --assume-unchanged /Users/huibaoqi/Documents/project/CloudHXQProject/hxq-cloud-service-mall/hxq-cloud-service-api/src/main/resources/logback-spring.xml

cd hxq-cloud-service-order&&git update-index --assume-unchanged /Users/huibaoqi/Documents/project/CloudHXQProject/hxq-cloud-service-order/hxq-cloud-service-api/src/main/resources/logback-spring.xml

cd hxq-cloud-service-scale&&git update-index --assume-unchanged /Users/huibaoqi/Documents/project/CloudHXQProject/hxq-cloud-service-scale/hxq-cloud-service-api/src/main/resources/logback-spring.xml

cd hxq-cloud-service-user&&git update-index --assume-unchanged /Users/huibaoqi/Documents/project/CloudHXQProject/hxq-cloud-service-user/hxq-cloud-service-api/src/main/resources/logback-spring.xml

cd hxq-cloud-web-dapi&&git update-index --assume-unchanged /Users/huibaoqi/Documents/project/CloudHXQProject/hxq-cloud-web-dapi/src/main/resources/logback-spring.xml

cd hxq-cloud-web-manage&&git update-index --assume-unchanged /Users/huibaoqi/Documents/project/CloudHXQProject/hxq-cloud-web-manage/src/main/resources/logback-spring.xml

cd hxq-cloud-web-openapi&&git update-index --assume-unchanged /Users/huibaoqi/Documents/project/CloudHXQProject/hxq-cloud-web-openapi/src/main/resources/logback-spring.xml

cd hxq-cloud-web-openm&&git update-index --assume-unchanged /Users/huibaoqi/Documents/project/CloudHXQProject/hxq-cloud-web-openm/src/main/resources/logback-spring.xml

cd hxq-cloud-web-papi&&git update-index --assume-unchanged /Users/huibaoqi/Documents/project/CloudHXQProject/hxq-cloud-web-papi/src/main/resources/logback-spring.xml

src/components/common/ModalWrapper/index.vue