git命令

一 设置配置信息
config 配置有三个级别, --global 全局配置;–system 系统配置; --local 存储库配置
1.1 设置配置文件(config只需要配置一次)

git config --global user.name "name"
git config --global user.name "邮箱"

1.2 查看配置

git config --system --list #查看系统配置
git config --global --list   #查看全局配置
git config --local --list     #查看存储库配置,注意需要切换目录到你的仓库下,在执行查看命令
git config                        #查看git信息

1.3 修改配置

git config --global --replace-all user.name  "邮箱"

1.4 删除配置

#首先新增一个配置项
git config --local --add  alibaba.ss "beijing"
#开始删除
git config --local --unset alibaba.ss  #删除配置项alibaba.ss

代码管理
2.1 上传文件
2.1.1 先在github上创建仓库
创建完成以后,保留远程仓库URL:https://github.com/baicun/city.git

2.1.2 本地目录初始化

git init  #git初始化
git status #查看状态

2.1.3 添加版本控制

git add "abc.txt"
git commit -m "first commit"  #提交说明

2.1.5 提交到远程仓库

git remote add city https://........
remote 远程    city 别名 默认 origin
上传

git push -u city master
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值