无法使用git add暂存文件夹以进行提交.或git add -u [英] Can't stage folder for commit with git add . or git add -u

查看:125
本文介绍了无法使用git add暂存文件夹以进行提交.或git add -u的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,如果我处于git状态,则会得到:

so if I do a git status I get:

bsg-integration> git status
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)

    modified:   bsg-services (untracked content)

no changes added to commit (use "git add" and/or "git commit -a")

然后我尝试使用 git add. git add -u ,但是当我使用 git status 时,我仍然得到相同的结果.这是怎么回事,以及如何将该文件夹推送到github?在我的github存储库上,bsg-services文件夹显示为灰色文件夹.这是什么意思?谢谢!

I then tried using git add . and git add -u but I still get the same thing when i use git status. What is going on and how to I push this folder to github? On my github repo the folder bsg-services is showing up as a greyed out folder. What does this mean? Thanks!

推荐答案

它( bsg-services )是 此灰色git图标是什么?")

您需要:

  • 首先进入该文件夹(并从该子仓库中推送)来添加/提交,
    ( bsg-services 内部的git状态将告诉您更多信息)
  • 然后返回父仓库(您所在的位置),添加,提交和推送.
    您将在 bsg-services 内部完成的提交将修改 gitlink条目在父仓库的索引中.
  • add/commit by going in that folder first (and push from that sub repo),
    (a git status inside bsg-services will tell you more)
  • then go back to the parent repo (where you are), add, commit and push.
    The commit you will have done inside bsg-services will have modified the gitlink entry in the index of your parent repo.

因此您需要两次下推:

  • 从子模块存储库到其上游存储库的一个( git remote -v 应该向您显示)
  • 来自父仓库的一个,以便记录存储该子模块新状态的新gitlink SHA1.

这篇关于无法使用git add暂存文件夹以进行提交.或git add -u的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆