Linux上传代码到GitHub
Linux上传代码到GitHub
克隆到本地
[root@Docker ~/111]# git clone https://github.com/Mike1319/docker-nginx.git 正克隆到 'docker-nginx'... remote: Enumerating objects: 12, done. remote: Counting objects: 100% (12/12), done. remote: Compressing objects: 100% (9/9), done. remote: Total 12 (delta 1), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (12/12), done. [root@Docker ~/111]#
进入本地仓库目录
[root@Docker ~/111/docker-nginx]# git init 重新初始化现存的 Git 版本库于 /root/111/docker-nginx/.git/ [root@Docker ~/111/docker-nginx]# ll 总用量 12 -rw-r--r-- 1 root root 6190 5月 7 12:41 conf.tar -rw-r--r-- 1 root root 1246 5月 7 12:41 README.md [root@Docker ~/111]# cd .. [root@Docker ~]# ll 总用量 0 drwxr-xr-x 3 root root 26 5月 7 12:45 111 drwxr-xr-x 3 root root 35 5月 7 11:32 1.21.0 drwxr-xr-x 3 root root 51 5月 7 12:44 docker-nginx
添加上传文件
[root@Docker ~]# mv 1.21.0 111/docker-nginx/ [root@Docker ~]# cd 111/docker-nginx/ [root@Docker ~/111/docker-nginx]# ll 总用量 12 drwxr-xr-x 3 root root 35 5月 7 11:32 1.21.0 -rw-r--r-- 1 root root 6190 5月 7 12:41 conf.tar -rw-r--r-- 1 root root 1246 5月 7 12:41 README.md 添加仓库内所有文件 [root@Docker ~/111/docker-nginx]# git add --all
配置用户
[root@Docker ~/111/docker-nginx]# git config --global user.name "Mike1319" [root@Docker ~/111/docker-nginx]# git config --global user.email "mike1319@163.com" [root@Docker ~/111/docker-nginx]#
提交注释
[root@Docker ~/111/docker-nginx]# git commit -m "添加dockerfile" [main e47d724] 添加dockerfile 16 files changed, 485 insertions(+) create mode 100644 1.21.0/Dockerfile create mode 100644 1.21.0/etc/entrypoint.sh create mode 100644 1.21.0/etc/logrotate.d/supervisord create mode 100644 1.21.0/etc/nginx-conf-example/17monipdb.datx create mode 100644 1.21.0/etc/nginx-conf-example/block_injections.conf create mode 100644 1.21.0/etc/nginx-conf-example/nginx.conf create mode 100644 1.21.0/etc/nginx-conf-example/rewrite/discuz.conf create mode 100644 1.21.0/etc/nginx-conf-example/rewrite/drupal.conf create mode 100644 1.21.0/etc/nginx-conf-example/rewrite/ecshop.conf create mode 100644 1.21.0/etc/nginx-conf-example/rewrite/joomla.conf create mode 100644 1.21.0/etc/nginx-conf-example/rewrite/opencart.conf create mode 100644 1.21.0/etc/nginx-conf-example/rewrite/typecho.conf create mode 100644 1.21.0/etc/nginx-conf-example/rewrite/wordpress.conf create mode 100644 1.21.0/etc/supervisord.conf create mode 100644 1.21.0/etc/supervisord.d/crond.ini create mode 100644 1.21.0/etc/supervisord.d/nginx.ini
连接GitHub
[root@Docker ~/111/docker-nginx]# git remote set-url origin https://121_n1IeNno@github.com/Mike1319/docker-nginx.git
推送到仓库
[root@Docker ~/111/docker-nginx]# git push origin main Counting objects: 25, done. Delta compression using up to 2 threads. Compressing objects: 100% (23/23), done. Writing objects: 100% (24/24), 849.39 KiB | 0 bytes/s, done. Total 24 (delta 1), reused 0 (delta 0) remote: Resolving deltas: 100% (1/1), done. To https://121_n1IeNno@github.com/Mike1319/docker-nginx.git 6a9120b..e47d724 main -> main
本文分享完毕,感谢支持点赞~~