将本地项目上传gitee实战
Posted 江湖有缘
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了将本地项目上传gitee实战相关的知识,希望对你有一定的参考价值。
将本地项目上传gitee实战
一、git的本地初始化操作
1.配置本地git相关信息
[root@192 k8s]# git config --global user.name "wangming"
[root@192 k8s]# git config --global user.email "123456@qq.com"
[root@192 k8s]# git config --global color.ui true
[root@192 k8s]#
2.查看git配置信息
[root@192 k8s]# cat ~/.gitconfig
[user]
name = wangming
email = 123456@qq.com
[color]
ui = true
2.创建本地仓库
1.创建工作区
[root@192 k8s]# git init .
Initialized empty Git repository in /git/k8s/.git/
[root@192 k8s]# ls -a
. .. data .git
2.将项目文件保存在暂存区
git add .
3.将暂存区文件保存在本地仓库
git commit -m "1.0 master-wangming create item for k8s's yaml "
二、连接到远程仓库
1.连接远程仓库
git remote add origin https://gitee.com/sadmin/kubernetes-yaml.git
2.查看连接状态
[root@192 data]# git remote -v
origin https://gitee.com/sadmin/kubernetes-yaml.git (fetch)
origin https://gitee.com/sadmin/kubernetes-yaml.git (push)
三、上传到远程gitee仓库
[root@192 data]# git push -u origin master
Username for 'https://gitee.com': admin
Password for 'https://admin@gitee.com':
Counting objects: 822, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (810/810), done.
Writing objects: 100% (821/821), 108.68 MiB | 3.55 MiB/s, done.
Total 821 (delta 609), reused 0 (delta 0)
remote: Resolving deltas: 100% (609/609), completed with 1 local object.
remote: Powered by GITEE.COM [GNK-6.3]
To https://gitee.com/sadmin/kubernetes-yaml.git
ffc584b..28dd1ea master -> master
四、查看gitte上代码
以上是关于将本地项目上传gitee实战的主要内容,如果未能解决你的问题,请参考以下文章