git使用说明(码云)

git使用说明(码云)

如何生成SSH公钥

1. 安装git

双击 Git-2.21.0-64-bit.exe 一路回车即可安装

2. 公钥生成

桌面右键打开Git Bash Here, 使用如下命令生成公钥, 一路回车即可.

ssh-keygen

显示如下

Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\dotcoo/.ssh/id_rsa):
Created directory 'C:\Users\dotcoo/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\dotcoo/.ssh/id_rsa.
Your public key has been saved in C:\Users\dotcoo/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:qZlpETjCUIdKcjCY7pzAqZlpETjCUIdKcjCY7pzA dotcoo@DESKTOP-347FRPP
The key's randomart image is:
+---[RSA 2048]----+
|=+...   ..       |
|+=o. .    .      |
|=o+ + o .  +     |
|o+ + o *.+=.o    |
|o+ + o *.+=.o    |
| +   . O E..o    |
|+=o. .    .      |
|+=o. .    .      |
|=+...   ..       |
+----[SHA256]-----+

第七行的 C:\Users\dotcoo/.ssh/id_rsa.pub 就是公钥

用vs直接打开这个文件 复制文件内容到 码云的公钥中.

3. 码云地址

创建新git仓库

若已创建项目,不要勾选 使用Readme文件初始化这个仓库

https://gitee.com/projects/new

4. 添加根目录文件

.gitignore

node_modules
.idea
.vscode
.git

README.md

## 制作首页App组件
1. 完成 Header 区域,使用的是 Mint-UI 中的Header组件
2. 制作底部的 Tabbar 区域,使用的是 MUI 的 Tabbar.html
未完待续...

LICENSE

The MIT License (MIT)

Copyright (c) 2014 connors and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

5. 初始化个人信息

只需要执行一次

git config --global user.name "姓名"
git config --global user.email "邮箱@163.com"

git初始化

每个项目只需要初始化一次

git init

查看状态

git status

添加变化的文件

每次修改了文件需要执行此命令

git add .

提交到本地

将修改的内容提交本地

git commit -m "更新描述"

添加远程服务器

git remote add origin https://gitee.com/用户名/git仓库名称.git

推送到远程服务器

git push -u origin master

每日打卡

以后每天下边以后,操作这三步即可.

git add .
git commit -m "更新描述"
git push
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,我会为您详细说明Git的安装及将代码托管到码云的步骤。 1. Git的安装 首先,您需要下载并安装Git客户端,下载链接:https://git-scm.com/downloads 。 安装过程中,您可以根据需要进行一些自定义设置。在选择组件时,建议选择默认的选项。在配置Git时,您需要设置用户名和邮箱地址,这将被用于您在提交代码时的身份标识。 安装完成后,打开命令行窗口(Windows下为cmd),输入git --version,如果出现版本号则说明Git已经安装成功。 2. 将代码托管到码云 接下来,我们将会把本地的代码托管到码云上。 首先,您需要在码云上创建一个代码仓库。在仓库页面中,您可以找到Git仓库的地址(如:git@gitee.com:username/repo.git)。 在本地代码目录下,右键打开Git Bash(如果您使用的是Windows系统),输入以下命令: ``` git init ``` 这将会在当前目录下创建一个.git的隐藏文件夹,用于存储Git的版本控制信息。 然后,您需要将本地代码仓库与码云上的仓库建立连接,输入以下命令: ``` git remote add origin git@gitee.com:username/repo.git ``` 其中,username是您的码云账号名,repo是您在码云上创建的仓库名。 接下来,将本地代码添加到Git的版本控制中: ``` git add . ``` 其中的“.”表示添加所有文件。 提交代码: ``` git commit -m "Initial commit" ``` 其中,“Initial commit”是提交信息。 最后,将代码推送到码云上: ``` git push -u origin master ``` 其中,“master”是您的本地代码分支名。 如果您的代码成功推送到码云上,那么恭喜您,您已经将代码托管到了码云上。 希望这些步骤对您有所帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值