search

Home  >  Q&A  >  body text

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

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

大家讲道理大家讲道理2800 days ago622

reply all(1)I'll reply

  • PHPz

    PHPz2017-04-22 09:01:42

    I specifically tested it on the OSC website and found that it works. Here is the code I used

    The detailed Repository can be found at http://git.oschina.net/redchamber/testproj

    I added jpg and png files in the root directory and images directory respectively. The code is as follows

    git add images
    git commit -m "Test"
    git push
    

    Your push failed. Can you please post the command used and the corresponding error output? When asking technical questions, you have done a good job by pointing out the operating system you are using, but if you can post the corresponding commands and output, it will be very helpful for others to help you analyze, locate and solve the problem.

    Also: I am not from OSC, I am just a netizen who is making soy sauce ^_^

    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.png
    nothing 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.png
    liudeMacBook-Pro-3:testproj larry$ git push
    Counting 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 -> master
    liudeMacBook-Pro-3:testproj larry$ 
    

    reply
    0
  • Cancelreply