Git常用指令

Mussy Hu

克隆仓库

1
git clone repo_url

配置账号

config 后添加 --global 则为全局配置,否则为当前目录下的 git 仓库的配置

  1. 用户名
1
git config user.name "musdrop"
  1. 邮箱
1
git config user.email "2712448668@qq.com"
  1. 密码
1
git config user.password "password"

配置代理

以下配置为方便使用默认启用全局配置

  1. 全局
1
git config --global http.proxy http://172.24.176.1:33210
1
git config --global https.proxy https://172.24.176.1:33210
  1. 特定网站
1
git config --global http.https://github.com.proxy http://172.24.176.1:33210
1
git config --global https.https://github.com.proxy https://172.24.176.1:33210
  1. 取消代理
1
git config --global --unset http.proxy
1
git config --global --unset https.proxy
  1. 查看已有全局配置
1
git config --global -l

配置远程仓库

orgin 可被更改成别的名字,url 为远程仓库链接

1
git remote add origin [url]

待更新…

  • 标题: Git常用指令
  • 作者: Mussy Hu
  • 创建于 : 2024-04-08 19:29:56
  • 更新于 : 2024-12-02 21:25:29
  • 链接: https://blog.musdrop.com/2024/04/08/Git常用指令/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。