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 自定义远程仓库的别名 远程仓库的分支
相关推荐
你是我的幸运儿15 小时前
git分支命名规范
git
果子⌂1 天前
Git+Jenkins实战(一)
运维·git·jenkins
苦逼IT运维1 天前
Jenkins + SonarQube 从原理到实战四:Jenkins 与 Gerrit 集成并实现自动任务
运维·git·测试工具·ci/cd·jenkins
_童年的回忆_2 天前
Linux下解决Git保存用户名和密码的方法
linux·运维·git
你的人类朋友2 天前
git常见操作整理(持续更新)
前端·git·后端
你的人类朋友2 天前
git中的Fast-Forward是什么?
前端·git·后端
@蓝眼睛2 天前
mac的m3芯片通过Homebrew安装git
git·macos
郭二哈2 天前
git的使用
大数据·网络·git·elasticsearch
叔叔别拉了我害怕2 天前
封装FTPSClient连接ftps服务器
服务器·git·github
火车叼位2 天前
Git 历史清理实践:彻底移除误提交的 node_modules
git