git使用

一.git安装

二.用户配置

1.本地用户

cpp 复制代码
git config --local user.name//查看全局用户名称
git config --local user.email//查看全局用户邮箱
  • 配置当前项目用户
cpp 复制代码
git config --user.name  "用户名"
git config --user.email  "邮箱名"

2.全局用户

cpp 复制代码
git config --global user.name//查看全局用户名称
git config --global user.email//查看全局用户邮箱
  • 配置全局用户
cpp 复制代码
git config --global user.name  "用户名"
git config --global user.email  "邮箱名"

三.推送到远程仓库

1.初始化本地仓库

cpp 复制代码
git init

2.添加文件到暂存区

cpp 复制代码
git add 文件名//添加指定文件
git add . //添加本目录下所有文件

git status //查看暂存区情况

3.连接远程仓库

cpp 复制代码
git remote//查看远程仓库连接情况
git remote add //自定义远程仓库别名 远程仓库地址

4.获取远程库与本地同步合并

cpp 复制代码
git pull --rebase 自定义的远程仓库别名 合并同步的分支

5.推送到远程仓库

cpp 复制代码
git push -u 自定义远程仓库的别名 远程仓库的分支
相关推荐
测试开发技术12 小时前
使用 Git 时出现 unable to access,如何解决?
git·面试题
zhougl99613 小时前
git项目,有idea文件夹,怎么去掉
java·git·intellij-idea
tmacfrank21 小时前
Git 使用技巧与原理(一)—— 基础操作
git
dilvx1 天前
git 配置 default editor
git
特种加菲猫1 天前
构建完整工具链:GCC/G++ + Makefile + Git 自动化开发流程
linux·笔记·git·自动化
Franklin2 天前
VS 版本更新git安全保护问题的解决
git
我是一只代码狗2 天前
idea中合并git分支
git
我是一只代码狗2 天前
idea中使用git
git·gitee·github
恋喵大鲤鱼2 天前
git restore
git·git restore
李少兄2 天前
Git Commit Message写错后如何修改?已Push的提交如何安全修复?
git·安全