简单的 Github 提交不起作用(尝试将图像添加到我的公共图像文件夹)
所以我试图做一些我知道很简单但让我头痛的事情。我只是想从我的应用程序中获取图像(我使用 MacFusion ssh 到我们的应用程序,而不是将其放在本地计算机上)。我基本上将图像与其他一些 html/css 更改一起拖到 public/images 文件夹中然后使用 git commit -a -m "comment about my commit here" 提交所有内容...
然后我推送到 github
所以我认为这会自动将图像添加到 github 中的 public/images 文件夹(& 在我们的服务器上),但事实并非如此。所有其他 html 和样式发生了变化,但当我查看 github 时,图像没有显示在 public/images 文件夹中。
我确信这是我忽略的愚蠢的事情,但确实可以使用一个快速的原因来说明发生这种情况的原因以及如何将一个图像文件发送到 github 中的 public/images 文件夹的说明。
非常感谢
So i'm trying to do something i know is simple but its causing me some headaches. I am just trying to get an image from my app (im using MacFusion to ssh to our app vs having it on my machine locally). I basically dragged an image into the public/images folder along w/ some other html/css changes & then committed everything using git commit -a -m "comment about my commit here"...
I then pushed to github
So i thought that wouldve automatically added the image to the public/images folder in github (& on our server), but it didn't. all the other html & style changes went through but the image didn't show up in the public/images folder when i look in github.
I"m sure this is something dumb i'm overlooking but could really use a quick reason this is happening & instruction on how to get that one image file to the public/images folder in github.
thanks so much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
git commit -a
不会添加新文件。它只是提交对已跟踪文件的更改。尝试执行
git add .
。或者显式添加文件并提交和推送。使用 git status 查看文件是否已添加。
git commit -a
doesn't add new files. It just commits changes to already tracked file.Try doing a
git add .
.Or add the files explicitly and commit and push.Use git status to see whether the files were added or not.
听起来该文件当前未被 Git 跟踪!
您必须首先添加文件以便 git 跟踪它。
即
两个有用的命令包括:
要列出当前在此 git 存储库中跟踪的所有文件,请使用:
要查看当前目录中是否有任何文件当前未跟踪,只需运行
可以在此处找到 git 命令的相当不错的秘籍:
https://github.com/AlexZeitler/gitcheatsheet/blob/master/gitcheatsheet.pdf
It sounds like the file is currently untracked by Git!
You must first add the file for git to track it.
i.e.
Two useful commands include:
To list all files currently tracked in this git repository, use:
To see if any files are currently untracked in your current directory, simply run
A pretty good cheatsheat of git commands can be found here:
https://github.com/AlexZeitler/gitcheatsheet/blob/master/gitcheatsheet.pdf