本篇文章给大家带来了关于Gitee的相关知识,其中主要跟大家介绍Git是什么?怎么安装?以及Gitee是怎么使用的?很详细的图文教程哦~感兴趣的朋友下面一起来看一下吧,希望对大家有帮助。
文章目录
- Git 简介
- 安装 Git
- 创建远程仓库
- 添加 SSH 密钥
- 创建本地仓库
- 修改本地仓库,提交到远程仓库
- 远程仓库同步到本地仓库
1. Git 简介
Git(读音为/gɪt/)是一个开源的分布式版本控制系统,可以有效、高速地处理从很小到非常大的项目版本管理。也是Linus Torvalds为了帮助管理Linux内核开发而开发的一个开放源码的版本控制软件。2. 安装 Git
- Git 的下载地址为:
- 下载对应的系统版本(macOS,Windows,Linux)的 Git,下载完成后,双击安装包,进行安装,安装流程如下:
- 安装过程中选择系统默认选项即可,一直点击 Next,直到安装完成;
3. 创建远程仓库
我们需要在 Gitee 上创建一个远程代码仓库(与远程仓库相对应的,是我们创建在本地的本地代码仓库);
进入 Gitee 网页,登录后点击头像左侧的加号,选择新建仓库;
填写仓库信息,仓库名称自行定义,其余选项默认,完成后点击确认;
- 如下图,创建了一个空的代码仓库,此刻仓库里只有一个默认的 .gitgnore 文件,仓库地址为
gitee.com/Cait7/learngit
4. 添加 SSH 密钥
- 进入 Git Bash (之前安装的 Git 软件),首先创建一个本地 ssh 密钥,这个密钥用于本地代码仓库和远程仓库之间的验证,输入命令如下,建议填写 Gitee 注册所使用的邮箱;
ssh-keygen -t rsa -C "youremail@youremail.com" Generating public/private rsa key pair... 三次回车即可生成 ssh key复制代码
- 输入命令,查看生成的 ssh 密钥:
cat ~/.ssh/id_rsa.pub复制代码
复制这一段 ssh 密钥,并将它添加到 Gitee 上,Gitee -> 个人信息-> SSH 公钥 -> 输入公钥名和公钥 -> 点击确定
添加完成后,在 Git Bash 上输入如下命令;
1 $ ssh -T git@gitee.com
输入命令后显示如下;
继续输入用户的 name 和 emali 属性;
git config --global user.name "yourname"git config --global user.email "youremail@youremail.com"
5. 创建本地仓库
我们可以直接将远程仓库克隆本地,后面是要克隆的仓库地址;
1 先在桌面创建一个文件夹,在这里我创建的文件夹名称是 MAD_Repo 2 cd Desktop/MAD_Repo 3 git clone https://gitee.com/Cait7/learngit
- 第一次 Clone 需要输入 Gitee 账号和密码,完成克隆后可以看见如下文件夹;
- 上述初始化本地仓库的方式是通过 git clone 实现的,另一种初始化本地仓库的方式如下:
1 $ cd d:/test //首先在文件系统中创建一个项目文件夹,然后在Git中 cd 到这个工程目录 2 $ git init //初始化本地项目 3 $ git remote add origin <远程仓库地址> //绑定远程仓库 4 #注:地址形式为 https://gitee.com/yourname/test.git 或 git@gitee.com:yourname/test.git
6. 修改本地仓库,提交到远程仓库
- 我们在本地仓库中新建一个文件 HelloMAD;
- 将本地仓库的更新同步到远程仓库的做法如下: - git add 需要更新的文件名 (可以使用 git add . 表示提交当前路径下的所有文件); - git commit -m“提交信息” (提交一个更新操作,双引号内填写备注); - git push origin master (将该更新操作上传到远程仓库);
- 完成后,远程仓库被更新为:
7. 远程仓库同步到本地仓库
1 $ cd d:/test 2 $ git pull origin master
The above is the detailed content of 图文详解Gitee的使用操作. For more information, please follow other related articles on the PHP Chinese website!

Git is a distributed version control system, and GitHub is an online platform based on Git. Git is used for version control, branch management and merger, and GitHub provides code hosting, collaboration tools and social networking capabilities.

Git is a back-end version control system, and GitHub is a front-end collaboration platform based on Git. Git manages code version, GitHub provides user interface and collaboration tools, and the two work together to improve development efficiency.

Git is a version control system, and GitHub is a Git-based code hosting platform. Git is used to manage code versions and history, and GitHub provides code hosting and collaboration capabilities. Git is suitable for all projects that require version control, GitHub is suitable for team collaboration and open source projects.

Git is a distributed version control system, and GitHub is an online platform based on Git. Git provides version control features such as branch management and commit history; GitHub provides collaboration tools such as code review and project management.

Git and GitHub are the core tools of modern software development. Git is a distributed version control system, while GitHub is a collaboration platform. Using Git and GitHub can improve development efficiency and enhance team collaboration.

Git is a distributed version control system created by Linus Torvaz in 2005, while GitHub is an online collaboration platform based on Git. Git records file changes through snapshots and supports branch models. GitHub provides tools such as PullRequest to improve collaboration efficiency.

GitHub is not just a version control tool, it also provides collaboration, project management and community communication capabilities. 1) Version control: Use Git to track code changes. 2) Collaboration: Submit code changes through PullRequest. 3) Project management: Use Issues and Project sections to manage tasks. 4) Community communication: Learn and communicate through fork and participating in open source projects.

Git and GitHub are different tools: Git is a version control system, and GitHub is an online platform based on Git. Git is used to manage code versions, and GitHub provides collaboration and hosting capabilities.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.
