首页 > 其他分享 >使用gitee管理项目(git指令版)

使用gitee管理项目(git指令版)

时间:2023-03-23 21:25:49浏览次数:41  
标签:git -- fau152 global gitee 指令 config

1. 新建远程仓库

image-20230323205859055

image-20230323205922409

2. 新建本地仓库

  1. 新建一个本地文件夹

  2. 在文件夹中打开GitBash

    git config --global user.name fau152   	#设置提交用户名为fau152
    git config --global user.email [email protected]  #设置提交邮箱
    git config --global http.sslVerify true
    git config --global core.autocrlf true
    git init  #初始化本地库
    git remote add origin https://gitee.com/fau152/stm32_template.git   #关联远程库,取别名为origin
    git pull --rebase origin master  #拉取远程仓库的文件到本地(主要是readme.md)
    git add .  #将本地所有的文件添加到本地库
    git commit -m "first commit"  #提交文件到本地库
    git push origin master  #push到远程仓库
    

    需要注意的问题:

    1. 缺少安全认证,提示:

      warning: ----------------- SECURITY WARNING ----------------
      warning: | TLS certificate verification has been disabled! |
      warning: ---------------------------------------------------
      warning: HTTPS connections may not be secure. See https://aka.ms/gcmcore-tlsverify for more information.
      

      解决办法:执行git config --global http.sslVerify true

    2. 提示:warning: LF will be replaced by CRLF

      解决办法:git config --global core.autocrlf false

      参考:git提示“warning: LF will be replaced by CRLF”的解决办法_青崖林夕的博客-CSDN博客

    3. 提交不上去,提示:

      remote: Powered by GITEE.COM [GNK-6.0]
      remote: error: GE007: Your push would publish a private email address.        
      remote: You can make your email public or disable this protection by visiting:        
      remote: https://gitee.com/profile/emails
      remote: error: hook declined to update refs/heads/master        
      error: failed to push some refs to 'https://gitee.com/ck_567/leet-code-practice.git'
      To https://gitee.com/ck_567/leet-code-practice.git
      !	refs/heads/master:refs/heads/master	[remote rejected] (hook declined)
      Done
      

      原因:gitee上设置了不公开邮箱地址,而本地提交的时候使用个人邮箱去提交的,所以被拦截

      解决办法:

      git config --global user.name fau152   	#设置提交用户名为fau152
      git config --global user.email [email protected]  #设置提交邮箱
      

      image-20230323204345948

      用于设置本地邮箱为gitee官网给的用于提交的邮箱。

标签:git,--,fau152,global,gitee,指令,config
From: https://www.cnblogs.com/fau152/p/17249458.html

相关文章

  • 使用Git统计指定时间范围内新增、删除代码行数
    统计命令gitlog--author="xxx"--since='2023-03-20'--until='2023-03-21'--pretty=tformat:--numstat|gawk'{add+=$1;subs+=$2;loc+=$1-$2}END{......
  • 【THM】Intro to Digital Forensics(数字取证介绍)-学习
    本文相关的TryHackMe实验房间链接:https://tryhackme.com/room/introdigitalforensics本文相关内容:了解数字取证及其相关流程,并完成相关的简单实例。简介取证是指应用科......
  • 【jmeter】启动报错Uncaught Exception java.lang.IllegalAccessError: class com.git
    1、问题  之前是java8的时候装的jmeter突然不能用了,报错UncaughtExceptionjava.lang.IllegalAccessError:classcom.github.weisj.darklaf.ui.filech...... 2、......
  • 一些git使用命令
    1、新建仓库gitinit2、如果要本地更改文件,需要更新到远端。gitstatus#查看当前文件状态gitadd-A#"gitadd-A"命令用于将工作目录中所有已修改、已删除......
  • git基本概念
     Git的四个区域1.workspace:工作区,就是你在电脑里能看到的目录,也是编辑文件的位置2.index/stage:暂存区,用于保存即将提交到文件列表的信息,实际上是一个文件(.git/index文......
  • 分布式版本控制系统——Git 常用指令
    分布式版本控制系统——Git常用指令一、Git优缺点缺点:占用磁盘空间较大优点:版本切换时非常快,因为每个版本都是完整的文件快照,切换版本时直接恢复目标版本的快照即可特......
  • git批量删除分支
    1.删除本地分支gitbranch|grep'模糊匹配分支名'|xargsgitbranch-Deg:gitbranch|grep'feature_'|xargsgitbranch-D2.删除远程分支gitbranch-r|gr......
  • Git09-合并
    Git是一个分布式版本控制系统(DistributedVersionControlSystem,DVCS)。例如,它允许日本的一个开发人员和新泽西州的一个开发人员独立地制作与记录修改,而且它允许两个开发......
  • 通过命令修改git提交的注释信息
    1.修改最新一条commit注释信息通过gitcommit--amend命令修改注释信息,然后:wq进行保存,再重新提交2.修改多条commit注释信息输入命令:gitrebase-iHEAD~5......
  • Error message "error:0308010C:digital envelope routines::unsupported"
    由于升级Nodejs版本造成的,一般创建项目时为16.7.0版本,然后安装或升级了更高版本,再进行run的时候,会提示。Errormessage"error:0308010C:digitalenveloperoutines::unsu......