git

//  gittee/github 新建仓库,复制url

// 1. git 初始化
git init

//查看状态
git status

//2.提交到本地仓库
git add *
git commit -m "提交简介"

//3.连接远程仓库
git remote add origin url
// 连接远程仓库错误:`fatal:remote origin already exists` ,表示已经连接过了
//删除已有连接
git remote rm origin 
//查看已有连接
git remote -v

//4.拉取远程代码,如果不进行这一步,会导致下面push时报错:`error:failed to push some refs to url` ,因为远程文件read.me和本地read不一致。
// master 为分支名
git pull --rebase origin master

//5. 提交到远程仓库
git push origin master

//首次提交需要设置邮箱和用户名,--global 全局设置
 git config --global user.email "邮箱地址"
 git config --global user.name "用户名"
 
//查看配置信息: git config -l 或
git config --list 


//修改邮箱和用户名
git config --global --replace-all user.name "用户名"
git config --global --replace-all user.email "邮箱地址"

//创建新分支
git branch 分支名

//查看分支
git branch

//切换分支
git checkout 分支名

//删除分支,需要先切换到其他分支
git branch -d  要删除的分支名



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值