Git 快捷使用教程

Git 快捷使用

一、Git下载配置

1.1 下载

git-scm.com下载

image-20220901095429306

1.2 解压配置

image-20220901095923580

配置环境变量

image-20220901100019033

验证Git环境变量是否配置好

image-20220901100302593

1.3 git config

git config --global user.name "webrx"
git config --global user.email "webrx@126.com"
git config --global --list

##################################################
C:\Users\Administrator>git -v
git version 2.37.3.windows.1

C:\Users\Administrator>git config --global --list
fatal: unable to read config file 'C:/Users/Administrator/.gitconfig': No such file or directory

C:\Users\Administrator>git config --global user.name webrx

C:\Users\Administrator>git config --global user.email webrx@126.com

C:\Users\Administrator>git config --global --list
user.name=webrx
user.email=webrx@126.com

1.4 idea开发工具配置

image-20220901100538524

需要安装gitee插件

image-20220901101024768

二、建立项目库

2.1 init初始化

git init

image-20220901112425835

git init .

git init oa 新建立一个oa项目库(文件夹,里边有一个.git)

image-20220901112607766

2.2 clone

git clone gitee地址

image-20220901113257448

2.3 idea init

image-20220901115324663

image-20220901115412490

2.4 idea clone

image-20220901114813248

image-20220901115122554

三、项目远程仓库管理

3.1 .gitignore和README.md

.gitignore

在项目根目录下建立一个.gitignore文件,此文件是忽略文件。

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

.idea
.target
out
*.iml

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

README.md

在项目根目录下建立README.md文件,此文件使用markdown语法编写,主要用于项目的文字说明。

# repo

#### 介绍
{**以下是 Gitee 平台说明,您可以替换此简介**
Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}

#### 软件架构
软件架构说明


#### 安装教程

1.  xxxx
2.  xxxx
3.  xxxx

#### 使用说明

1.  xxxx
2.  xxxx
3.  xxxx

#### 参与贡献

1.  Fork 本仓库
2.  新建 Feat_xxx 分支
3.  提交代码
4.  新建 Pull Request


#### 特技

1.  使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2.  Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3.  你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4.  [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5.  Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6.  Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

3.2 git remote

Git 全局设置:

git config --global user.name "webrx"
git config --global user.email "webrx@126.com"

创建 git 仓库:

mkdir repo
cd repo
git init 
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/webrx/repo.git
git push -u origin "master"

已有仓库?

cd existing_git_repo
git remote add origin https://gitee.com/webrx/repo.git
git push -u origin "master"

image-20220901142752626

git clone

$ git clone https://www.gitee.com/webrx/wx_xmind.git

git fetch

git pull

3.3 idea

3.3.1 分享gitee.com

在idea中先安装gitee插件,还要设置一下git.exe位置,1.4小节有插图效果。

image-20220901141337695

3.3.2 get from vcs

image-20220901141417279

3.3.3 更新fetch pull
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值