# Git 常用命令

记录一些常用的git命令

# git init

#初始化项目,会生成.git目录
git init 

# git add

#把文件加入到暂存区中
git add 

# git remote

# 列出已经存在的远程仓库
 git remote

# 列出远程仓库的详细信息,在别名后面列出URL地址
 git remote -v
 git remote --verbose

# 添加远程仓库
 git remote add <远程仓库的别名> <远程仓库的URL地址>

# 修改远程仓库的别名
 git remote rename <原远程仓库的别名> <新的别名>

# 删除指定名称的远程仓库
 git remote remove <远程仓库的别名>

# 修改远程仓库的 URL 地址
 git remote set-url <远程仓库的别名> <新的远程仓库URL地址>

上次更新: 2024/9/30