gitcode代码仓库的基本使用

简介: gitcode代码仓库的基本使用

@TOC

一、gitcode官网简介

GitCode 是 CSDN 为开发者提供的开源项目创新服务平台,秉承“创新、开放、协作、共享”的开源价值观,致力于为大规模开源开放协同创新助力赋能,打造创新成果孵化和新时代开发者培养的开源创新生态!支持公有云使用、私有化部署以及软硬一体化私有部署。

二、本地配置

1.安装git工具

yum -y install git

2.配置本地git信息

[root@compute-node1 gitcode]# git config --global user.name "wangming"
[root@compute-node1 gitcode]# git config --global user.email "123456@qq.com"
[root@compute-node1 gitcode]# git config --global color.ui true
[root@compute-node1 gitcode]#

3.查看git个人信息

[root@compute-node1 gitcode]# cat ~/.gitconfig 
[user]
    name = wangming
    email = 123456@qq.com
[color]
    ui = true

二、创建本地仓库

1.创建本地工作区

[root@compute-node1 gitcode]# git init .
Initialized empty Git repository in /git/gitcode/.git/
[root@compute-node1 gitcode]# ls -a
.  ..  found_file.sh  .git
[root@compute-node1 gitcode]#

2.将文件放入暂存区

[root@compute-node1 gitcode]# git add .

3.将暂存区文件放入本地仓库

[root@compute-node1 gitcode]# git commit -m "1.0 master-wangming create item for test scripts  "
[master (root-commit) f1491e2] 1.0 master-wangming create item for test scripts
 1 file changed, 21 insertions(+)
 create mode 100755 found_file.sh

4.查看版本记录

[root@compute-node1 gitcode]# git log --oneline 
f1491e2 1.0 master-wangming create item for test scripts

三、gitcode网站个人仓库配置

1.登录个人仓库

在这里插入图片描述

2.新建个人仓库

在这里插入图片描述

3.查看个人仓库

在这里插入图片描述

四、连接远程仓库

1.连接gitcode

[root@compute-node1 gitcode]# git remote add origin https://gitcode.net/jks212454/it-items.git
[root@compute-node1 gitcode]#

2.查看连接状态

[root@compute-node1 gitcode]# git remote -v
origin    https://gitcode.net/jks212454/it-items.git (fetch)
origin    https://gitcode.net/jks212454/it-items.git (push)

五、配置ssh免密

1.查看本机公钥

[root@compute-node1 gitcode]# cat ~/.ssh/id_rsa.pub 
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjmRSBowMRzqDO4JFwveGTYZ/CtaOWKEu/G5GZ5HwYDDa/+Hps03DzXnOffkZARkPPmNNFVzE1/mCVA3LpMMDCeV3JfgrLLYSmwY4cNTgVMQ4NLs0uk4UkmBGwb/nP1IYX9Z+qpmGe/caUOFXGdvsGPRtjXC9llUGJCn1U4tkyhjX1hiwuPPlFl4XHw5w0EyCRwTtzzTn1Ma66DN5Ovc644GIbECnhVyOcXbzroZeiN3Ms+XfhVA/m9gCj9gXo+AUFC1wgHvwoBOLkx+PjKhOMz/nz4lSVEd/yURBGlcM6+wKYbTzeSdWGh0TG8mIMIBPd+vRIbNfW6R96NR/SLTMl root@localhost.localdomain

2.添加公钥到gitcode

在这里插入图片描述

六、上传文件到gitcode

[root@compute-node1 gitcode]# git push git@gitcode.net:jks212454/it-items.git
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 842 bytes | 0 bytes/s, done.
Total 5 (delta 0), reused 0 (delta 0)
To git@gitcode.net:jks212454/it-items.git
   56dcb17..24c29d9  master -> master
[root@compute-node1 gitcode]#

七、gitcode查看

在这里插入图片描述

相关文章
|
17天前
|
开发工具 数据安全/隐私保护 git
gitee使用方法介绍
gitee使用方法介绍
24 0
|
6月前
|
存储 开发工具 git
Git的简介以及基本使用
Git的简介以及基本使用
|
Shell 网络安全 开发工具
【Git用法】如何将本地项目上传到码云,只需这几步,每个步骤都有图文
如何将本地项目上传到码云,只需这几步,每个步骤都有图文
1360 0
【Git用法】如何将本地项目上传到码云,只需这几步,每个步骤都有图文
|
资源调度 开发工具 git
来!手把手教你创建自己的代码仓库(一)
来!手把手教你创建自己的代码仓库
来!手把手教你创建自己的代码仓库(一)
|
开发工具 git
来!手把手教你创建自己的代码仓库(二)
来!手把手教你创建自己的代码仓库
来!手把手教你创建自己的代码仓库(二)
|
缓存 JavaScript Unix
超详细Git下载安装配置使用教程,从入门到上传本地项目到GitHub,一文就够了
超详细Git下载安装配置使用教程,从入门到上传本地项目到GitHub,一文就够了
507 0
超详细Git下载安装配置使用教程,从入门到上传本地项目到GitHub,一文就够了
|
开发工具 git
gitee代码托管平台的基本使用与操作
gitee代码托管平台的基本使用与操作
195 1
gitee代码托管平台的基本使用与操作
|
Shell 开发工具 git
|
数据可视化 搜索推荐 Linux
SourceTree的基本使用(上)
今日目标 能够掌握SourceTree 安装 能够掌握SourceTree 连接远程仓库 能够掌握SourceTree克隆,拉取,提交,推送 能够掌握SourceTree 新建/切换/合并分支 能够掌握SourceTree 冲突解决 能够掌握SourceTree 提交PR(Pull Request)
|
缓存 开发工具 数据安全/隐私保护
SourceTree的基本使用(下)
今日目标 能够掌握SourceTree 安装 能够掌握SourceTree 连接远程仓库 能够掌握SourceTree克隆,拉取,提交,推送 能够掌握SourceTree 新建/切换/合并分支 能够掌握SourceTree 冲突解决 能够掌握SourceTree 提交PR(Pull Request)