【git】使用git bash上传一个多目录项目到码云的全记录

准备工作:

1.准备好本地目录,这次我选择的是21年秋季的作品PicturesShow,内含5个文件和一个子目录,程序在子目录中。

2.在码云上新建一个项目PicturesShow,并记下其网址 https://gitee.com/heyang78/pictures-show.git

3.如果没有git,到 https://gitforwindows.org/ 下载Git for windows,然后安装好,一路next即可。

之后进入目录C:\hy\gitee\picturesShow,右键点空白处选Git bash,打开Git控制台。

往下就是命令执行过程:

复制代码
ufo@DESKTOP-82T142Q MINGW64 /c/hy/gitee/picturesShow
$ git init
Initialized empty Git repository in C:/hy/gitee/picturesShow/.git/

ufo@DESKTOP-82T142Q MINGW64 /c/hy/gitee/picturesShow (master)
$ git add *.*

ufo@DESKTOP-82T142Q MINGW64 /c/hy/gitee/picturesShow (master)

$ git add .

ufo@DESKTOP-82T142Q MINGW64 /c/hy/gitee/picturesShow (master)
$ git commit -m "First Commit"
[master (root-commit) 31296c6] First Commit
 8 files changed, 603 insertions(+)
 create mode 100644 2021-08-08_080952.png
 create mode 100644 PicturesShowSrc/setting.txt
 create mode 100644 PicturesShowSrc/src/com/hy/Inlet.java
 create mode 100644 PicturesShowSrc/src/com/hy/ShowGui.java
 create mode 100644 README.md
 create mode 100644 picturesShow.jar
 create mode 100644 run.bat
 create mode 100644 setting.txt

ufo@DESKTOP-82T142Q MINGW64 /c/hy/gitee/picturesShow (master)
$ git remote add origin https://gitee.com/heyang78/pictures-show.git

ufo@DESKTOP-82T142Q MINGW64 /c/hy/gitee/picturesShow (master)
$ git push -u origin master
Enumerating objects: 14, done.
Counting objects: 100% (14/14), done.
Delta compression using up to 4 threads
Compressing objects: 100% (9/9), done.
Writing objects: 100% (14/14), 380.55 KiB | 15.22 MiB/s, done.
Total 14 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-6.1]
To https://gitee.com/heyang78/pictures-show.git
 * [new branch]      master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.

ufo@DESKTOP-82T142Q MINGW64 /c/hy/gitee/picturesShow (master)
$
复制代码

上面的步骤中,"git add .  " 是把子目录带入的关键一句话。

执行 git push -u origin master之后,软件会跳出对话框让你输入用户名密码,按实输入即可,如果git提示你装.net,不要理会,push工作仍会进行。

执行完毕后,刷新码云上项目PicturesShow,看到文件已经推送到其中,说明上传成功了。

 

END

posted @   逆火狂飙  阅读(136)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
历史上的今天:
2019-08-29 【高中数学/对数函数】函数y=lnx与y=1/lnx图像
2014-08-29 【Font】stencilstd英文字体下载
2013-08-29 【Canvas与图标】橙边蓝白红底竖立正方形恒字图标
2013-08-29 在Foreda8上试安装Apchehttpd-2.4.6.tar.gz
生当作人杰 死亦为鬼雄 至今思项羽 不肯过江东
点击右上角即可分享
微信分享提示