# testgit **Repository Path**: strawberry-coin/testgit ## Basic Information - **Project Name**: testgit - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-04-09 - **Last Updated**: 2021-06-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # README.md - 怎么使用 - 首先安装`git` - 安装完了后应该会自动添加环境变量,如果你在`cmd`中打入`git`命令,应该可以看到下面的输出 ``` usage: git [--version] [--help] [-C ] [-c =] [--exec-path[=]] [--html-path] [--man-path] [--info-path] [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare] [--git-dir=] [--work-tree=] [--namespace=] [] These are common Git commands used in various situations: start a working area (see also: git help tutorial) clone Clone a repository into a new directory init Create an empty Git repository or reinitialize an existing one work on the current change (see also: git help everyday) add Add file contents to the index mv Move or rename a file, a directory, or a symlink restore Restore working tree files rm Remove files from the working tree and from the index sparse-checkout Initialize and modify the sparse-checkout examine the history and state (see also: git help revisions) bisect Use binary search to find the commit that introduced a bug diff Show changes between commits, commit and working tree, etc grep Print lines matching a pattern log Show commit logs show Show various types of objects status Show the working tree status grow, mark and tweak your common history branch List, create, or delete branches commit Record changes to the repository merge Join two or more development histories together rebase Reapply commits on top of another base tip reset Reset current HEAD to the specified state switch Switch branches tag Create, list, delete or verify a tag object signed with GPG collaborate (see also: git help workflows) fetch Download objects and refs from another repository pull Fetch from and integrate with another repository or a local branch push Update remote refs along with associated objects 'git help -a' and 'git help -g' list available subcommands and some concept guides. See 'git help ' or 'git help ' to read about a specific subcommand or concept. See 'git help git' for an overview of the system. ``` - 此时说明你已经安装好了 - 配置`gitee` - 打开一个`cmd`,或者移动位置到`c:\users\你的用户名下` - `cd .ssh`,如果提示找不到指定路径,就输入这个命令`ssh-keygen -t rsa -C “你的邮箱”` 然后一直回车,直到出现一个奇怪的字符图。 示例: ``` Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/zhuxf/.ssh/id_rsa):##然后敲回车## Created directory ‘/c/Users/zhuxf/.ssh’. Enter passphrase (empty for no passphrase):##然后敲回车## Enter same passphrase again:##然后敲回车## Your identification has been saved in /c/Users/zhuxf/.ssh/id_rsa. Your public key has been saved in /c/Users/zhuxf/.ssh/id_rsa.pub. The key fingerprint is: SHA256:W5EdUQ1CYtH1prRPF9DLkeRhTlZalj09FdlozKB01X0 zhoupenglin@sunniwell.net The key’s randomart image is: +—[RSA 2048]—-+ | =+BXB%^| | o *.o%&E| | + ..++O| | . . *.| | S . o o| | o o.| | . .| | | | | +—-[SHA256]—–+ ``` - 这样就会创建一个`.ssh`文件夹,再次`cd .ssh`,然后`notepad id_rsa.pub`,会弹出一个记事本,复制里面的内容。 - 登录`gitee`,点个人主页(或者访问`https://gitee.com/你的用户名`),然后个人设置 - 点左侧SSH公钥 ![image-20210409215638300](./README.assets/image-20210409215638300.png) - ![image-20210409215732738](./README.assets/image-20210409215732738.png) - 然后确定 - 下载这个库 - 首先`cd`到一个文件夹下(你随意),然后`git clone https://gitee.com/strawberry-coin/testgit.git` - 此时就会再刚才那个文件夹下创建一个`testgit`文件夹,里面就是我们的项目代码 - 怎么上传 - 首先你要有更改 比如你修改了我下面的`1.txt`文件 - `git add ` + `修改文件名(可以有多个)` `git add 1.txt` - `git commit -m "你的描述"`这个命令打完之后版本暂存在了本地 - 然后上传云端`git push` 可能会让你输入用户名和密码,密码不会显示出来的,输完回车即可 - 怎么下载 - `git pull`