Loading

DATA

git常用基础命令
常用命令1. git init初始化一个 Git 仓库。git init2. git add将文件添加到 Git ...
扫描右侧二维码阅读全文
13
2023/04

git常用基础命令

常用命令

1. git init

初始化一个 Git 仓库。

git init

2. git add

将文件添加到 Git 仓库中。

# 添加单个文件
git add filename

# 添加整个目录
git add directoryname

3. git commit

将当前工作目录中的更改提交到 Git 仓库中。

git commit -m "commit message"

4. git push

将本地 Git 仓库中的更改推送到远程 Git 仓库。

git push origin master

5. git pull

从远程 Git 仓库中获取最新的更改。

git pull origin master

6. git clone

克隆一个远程 Git 仓库到本地。

git clone git@github.com:username/repository.git

配置代理

在某些情况下,由于网络原因,我们可能需要使用代理服务器才能访问 Git 仓库。以下是配置代理的命令:

# 配置 HTTP 代理
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:port

# 配置 HTTPS 代理
git config --global https.proxy https://proxyuser:proxypwd@proxy.server.com:port

参考文献:
ChatGPT

最后修改:2023 年 04 月 13 日 04 : 46 PM
如果觉得我的文章对你有用,请随意赞赏

发表评论