Git——Windows平台创建gitee私有仓库详解

目录

[1. 安装git](#1. 安装git)

[2. gitbash配置](#2. gitbash配置)

[2.1 设置](#2.1 设置)

[2.2 生成key](#2.2 生成key)

[2.3 项目管理](#2.3 项目管理)

[2.3.1 本地新建](#2.3.1 本地新建)

[2.3.2 clone远程仓库的工程到本地改文件](#2.3.2 clone远程仓库的工程到本地改文件)


1. 安装git

默认安装。

2. gitbash配置

2.1 设置

打开gitbash,设置用户名和邮箱:

git config --global user.name "yourname"

git config --global user.email "xxyyzz@163.com"

git config --global credential.helper store

  • yourname:你注册gitee时的用户名
  • xxyyzz@163.com:gitee里面的主邮箱
  • 第三句是记住前两句配置

使用如下命令,查看配置结果:

git config --list

2.2 生成key

输入:

ssh-keygen

敲3次回车!!!

打开如下目录的 id_rsa.pub

全选复制。然后打开我们的Gitee,进入设置-->SSH公钥-->在公钥区粘贴我们所copy的公钥,点击确定输入Gitee登陆密码进行验证即可。

2.3 项目管理

2.3.1 本地新建

(1)初始化

进入到指定的文件夹之后,使用git init指令将本地文件夹变成本地仓库

git init

本地文件夹多出一个隐藏文件:

(2)新建文件

新建文件夹,里面新建个文件:

(3)本地和远程关联起来

git remote add origin https://gitee.com/w-guchao/test.git

origin表示远程仓库的代名称

(4)拉下来远程仓库的readme等文件:

git pull --rebase origin master

(5)add,commit,push

git add test/
git commit -m "测试"
git push -u origin master

2.3.2 clone远程仓库的工程到本地改文件

(1)克隆

git clone xxx // 'xxx'表示需要克隆的仓库的链接

(2)本地修改提交

git status

获取状态:

(3)test文件夹内加个文件,再看状态::

(4)git add 文件名 表示将某个文件添加至暂存区。

(5)git commit -m "xxx", xxx表示自己对本次提交所进行的备注或者标注。

(6)git push 指令提交到服务端。

相关推荐
菜鸟一皓2 小时前
IDEA的lombok插件不生效了?!!
java·ide·intellij-idea
satan–03 小时前
R语言的下载、安装及环境配置(Rstudio&VSCode)
开发语言·windows·vscode·r语言
Good_Starry14 小时前
Git介绍--github/gitee/gitlab使用
git·gitee·gitlab·github
嵌入式小能手17 小时前
开发环境搭建之VScode的安装及使用
vscode·编辑器
N1cez19 小时前
vscode 连接服务器 不用输密码 免密登录
服务器·vscode
yufei-coder19 小时前
C# Windows 窗体开发基础
vscode·microsoft·c#·visual studio
white.tie1 天前
vscode配置golang
ide·vscode·golang
mashagua1 天前
本地访问autodl的jupyter notebook
ide·python·jupyter·autodl
DaphneOdera171 天前
Jupyter | jupyter notebook 使用 conda 环境
ide·jupyter·conda
一只积极向上的小咸鱼1 天前
jupyter本地配置
ide·python·jupyter