OSC的Git为什么不能添加项目中的images目录?

浏览:43日期:2023-11-03

问题描述

.gitignore文件内没有忽略这个images目录。补充:images里面是有图片的。Mac系统。

问题解答

回答1:

我特意在 OSC 的网站上做了测试,发现是可以的,下面是我用的代码

详细的Repository可以见 http://git.oschina.net/redchamber/testproj

我分别在根目录和images目录下添加了jpg以及png文件,代码如下

git add imagesgit commit -m 'Test'git push

你的push失败,能否请贴出所使用的命令和相应的错误输出?在询问技术相关问题时,指出自己所用的操作系统,你做的很好,但是如果能贴出相应的命令和输出,则会对于其他人帮助你分析,定位和解决问题非常有帮助。

另外:我并不是OSC的人,我只是一个打酱油的网友 ^_^

liudeMacBook-Pro-3:testproj larry$ git status# On branch master# Untracked files:# (use 'git add <file>...' to include in what will be committed)## test.jpg# test.pngnothing added to commit but untracked files present (use 'git add' to track)liudeMacBook-Pro-3:testproj larry$ git add .liudeMacBook-Pro-3:testproj larry$ git commit -m 'Add image files for testing'[master 49a8cd7] Add image files for testing 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 test.jpg create mode 100644 test.pngliudeMacBook-Pro-3:testproj larry$ git pushCounting objects: 4, done.Delta compression using up to 8 threads.Compressing objects: 100% (3/3), done.Writing objects: 100% (3/3), 106.80 KiB | 0 bytes/s, done.Total 3 (delta 0), reused 0 (delta 0)To http://git.oschina.net/redchamber/testproj.git 85c1353..49a8cd7 master -> masterliudeMacBook-Pro-3:testproj larry$

相关文章: