你的位置:催迷水 > 性药市场 >

手把手教你怎样上传代码到Gitee做事器

发布日期:2025-05-10 16:33    点击次数:58

之前编写了几个妥贴生手的小模样, 为便捷全球学习和下载代码, 决定把代码上传到gitee做事器。

不得不说,git是一个特殊好用的代码版块料理用具,本文手把手教全球怎样将我方编写的代码上传到Gitee。

1. 注册账号

掀开网页

https://gitee.com/

点击注册, 输入一个我方可爱的域名,yikoulinux输脱手机号,考证即可

点击注册并绑定 即可。

迷水商城

2.绑定微信

点击头像->竖立

迷水商城

然后会弹出二维码, 用我方的微信扫描二维码即可。

3. 绑定邮箱

后续版块料理操作需要绑定邮箱才气连续操作。

点击头像->竖立

迷水商城

点击 左边邮箱料理->新增然后输入刚才竖立的gitee登录密码

迷水商城

正确会插足底下页面, 输入我方的邮箱(一口君用的QQ邮箱)

迷水商城

点击细目

然后登录我方邮箱,点击对应的辘集即可。

弥漫之夜

4. 新建仓库

点击头像左侧的+ -> 新建仓库

输入称呼以及开源许可证等。

点击创建即可。

迷水商城5. clone克隆仓库到土产货

复制仓库辘集:

迷水商城

插足ubuntu 若是莫得装配git,不错履行以下号召装配git

sudo apt-get install git

设立git全局环境

git config --global user.name "yikoulinux"git config --global user.email "7335817@qq.com"

修改commit默许掀开的文本裁剪用具

git config --global core.editor "vim"

最先克隆:

root@ubuntu:/home/peng/work# git clone https://gitee.com/yikoulinux/encryption.gitCloning into 'encryption'...remote: Enumerating objects: 4,春药怎么买/春药购买方法 done.remote: Counting objects: 100% (4/4), done.remote: Compressing objects: 100% (4/4), done.remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0Unpacking objects: 100% (4/4), done.Checking connectivity... done.

检察克隆下来的文献夹

迷水商城
root@ubuntu:/home/peng/work# lsencryptionroot@ubuntu:/home/peng/work# cd encryption/root@ubuntu:/home/peng/work/encryption# lsLICENSE

检察git log

root@ubuntu:/home/peng/work/encryption# git logcommit 5e0d6d12afb34a8082c6ef60f34f6e615c99746eAuthor: 一口Linux <10221187+yikoulinux@user.noreply.gitee.com>Date:   Tue Dec 21 13:57:19 2021 +0000Initial commit

拷贝代码到面前目次

迷水商城
root@ubuntu:/home/peng/work/encryption# lskey.c  key.h  LICENSE  main.c  README.md

其中README.md是文档讲解,催迷水继承Markdown手艺编写。

迷水商城

添加源文献到土产酒店库:

365站群VIP
root@ubuntu:/home/peng/work/encryption# git add *root@ubuntu:/home/peng/work/encryption# git statusOn branch masterYour branch is up-to-date with 'origin/master'.Changes to be committed:(use "git reset HEAD <file>..." to unstage)modified:   LICENSEnew file:   README.mdnew file:   key.cnew file:   key.hnew file:   main.cChanges not staged for commit:(use "git add <file>..." to update what will be committed)(use "git checkout -- <file>..." to discard changes in working directory)modified:   .gitignore

履行commit

root@ubuntu:/home/peng/work/encryption# git commit

添加commit 的 log信息【此时裁剪用具是vim】

上传到做事器:

root@ubuntu:/home/peng/work/encryption# git pushwarning: push.default is unset; its implicit value has changed inGit 2.0 from 'matching' to 'simple'. To squelch this messageand maintain the traditional behavior, use:git config --global push.default matchingTo squelch this message and adopt the new behavior now, use:git config --global push.default simpleWhen push.default is set to 'matching', git will push local branchesto the remote branches that already exist with the same name.Since Git 2.0, Git defaults to the more conservative 'simple'behavior, which only pushes the current branch to the correspondingremote branch that 'git pull' uses to update the current branch.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)Username for 'https://gitee.com': yikoulinuxPassword for 'https://yikoulinux@gitee.com':Counting objects: 6, done.Compressing objects: 100% (6/6), done.Writing objects: 100% (6/6), 2.28 KiB | 0 bytes/s, done.Total 6 (delta 0), reused 0 (delta 0)remote: Powered by GITEE.COM [GNK-6.2]To https://gitee.com/yikoulinux/encryption.git5e0d6d1..484d5d4  master -> master

其中会条件输入用户名(伊始竖立的名字yikoulinux)密码,密码输入时不会回显。

最终在gitee上剖析效果:

这么咱们就到手的将土产货代码上传到做事器了。

迷水商城迷水商城6. 常用git号召
git clone 模样地址  拉模样git pull    拉代码git push  提交到仓库git init 请示开动化一个git仓库git add .添加文献git commit -m "能干"提交至仓库。git remote add origin https://git.oschina.net/你的用户名/模样名.git,git push origin master即可完成推送git checkout master   切换到master分支
7. 若是不思每次皆输入用户名密码不错

(1)生成ssh密钥

ssh-keygen -C '7335817@qq.com' -t rsa

会在用户目次~/.ssh/下建设相应的密钥文献。若是是料理员创建在目次/root/.ssh/下。

(2)上传公钥

迷水商城

使用号召cd ~/.ssh插足~/.ssh文献夹,输入

cat id_rsa.pub

掀开id_rsa.pub文献,复制其中悉数执行。接着探望git网页,点击SSH公钥,标题栏不错松驰输入,公钥栏把刚才复制的执行粘贴进去。

此外,一口君还创建了一个基于Linux的聊天室的开源模样, 基功能包括登录、注册、公聊、私聊、数据库、数据加密等功能。其他功能后续会无间完善。

https://gitee.com/yikoulinux/chat.git

本文转载自微信公众号「一口Linux」,不错通过以下二维码情切。转载本文请沟通一口Linux公众号。







Powered by 催迷水 @2013-2022 RSS地图 HTML地图

Powered by365站群