我和GitHub有点纠结(对于Mac,虽然我怀疑这是相关的)。
我最近只是转换为Git,所以在许多方面它仍然是未知的,今天是我第一次有理由同时激活两个分支。
我不确定发生了什么,但其中一个分支和master之间的合并没有按计划进行(不知何故,提交摘要在将hotfix_7.0与master合并时丢失了),所以我解除了提交。然而,出了点问题。
分支update_4.0包含:
application/modules/bookings/controllers/inspector.php
application/modules/bookings/models/data_bookings.php
application/modules/bookings/views/users/administrators/bookings/adjust.php
application/modules/invoices/controllers/invoices.php
application/modules/invoices/views/manage.php
application/modules/search/controllers/assets/invoices.php
application/modules/search/models/data_search.php
Branch hotfix_7.0包含:
application/modules/bookings/controllers/bookings.php
application/modules/bookings/controllers/inspector.php
application/modules/search/models/data_search.php
application/modules/venues/models/data_venues.php
当我切换到update_4.0时,没有待提交的文件,对于hotfix_7.0也是如此。但是当我切换到master时,update_4.0的文件显示为挂起提交。为什么?并且 - 更重要的是 - 我接下来应该做些什么来修复它?
更新:根据@twalberg的请求,这里是分支结构数据:
* 869e2f1 (HEAD, origin/hotfix_7.0, master, hotfix_7.0) An adjustment to the Search
| * c1e4c04 (update_4.0) Adjustments to Bookings, Invoicing, and Search
|/
* d2413f9 (origin/master, update_3.0) Update an Invoice PDF
* 6a77f1e (hotfix_6.0) General fixes
* fb04b7e (update_2.0) Advanced Search
* c8222fe (hotfix_5.0) Caching
* 3baea6a (feature_5.0) Caching
| *-. 5c08c19 (refs/stash) On hotfix_4.0: GitHub: stashing before switching branches.
| |\ \
|/ / /
| | * 9a6cd92 untracked files on hotfix_4.0: 0ed797b Invoice date range
| * e7e4bbd index on hotfix_4.0: 0ed797b Invoice date range
|/
* 0ed797b (hotfix_4.0) Invoice date range
* 4d9640d (hotfix_3.0) A fix to one of the search functions database methods, and the incl
* 8ee9f92 (feature_4.0) Users can now switch between Clients from anywhere in the system w
* 8d8752a (feature_3.0) In an effort to improve the invoicing process, I've made several a
* 2cff420 (hotfix_2.0) Switching references to the Commission for Venues column in Invoici
* 2403093 (feature_2.0) Statuses for Signatures, which allows the User to filter them in m
* 6572680 (hotfix_1.0) A conditional statement was checking against a string value as if i
* 6705899 (update_1.0) Alphabetical listing of Signatures for messages.
* 283bde4 (feature_1.0) Ability to edit group options in addition to group privileges for
* 79ded64 To Book 3
更新:根据@Ilion的请求,这里是分支结构数据:
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# 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)
#
# modified: application/modules/bookings/controllers/inspector.php
# modified: application/modules/bookings/models/data_bookings.php
# modified: application/modules/bookings/views/users/administrators/bookings/adjust.php
# modified: application/modules/invoices/controllers/invoices.php
# modified: application/modules/invoices/views/manage.php
# modified: application/modules/search/controllers/assets/invoices.php
# modified: application/modules/search/models/data_search.php
答案 0 :(得分:0)
至于为什么,我已经看到了子模块文件夹的这种行为 - 更改为没有它们的分支并且它们没有被删除 - 但我不希望有新的git使用子模块。这只会在任何情况下显示子模块文件夹,而不是子模块中的文件。
第二个问题的直接答案,如果您不想要更改,可以使用以下命令摆脱它们。
如果文件待提交被缓存在索引中(就像它们将在git add .
之后),您可以使用以下命令将它们从索引中删除:
git rm -r --cached .
如果它们没有编入索引,你可以使用以下内容完成它们,有时需要运行两次(例如第一次删除.gitignore
文件时)。
git clean -fd
下一步该做什么的更长远的答案取决于你想要结束的地方。我们可以在您的日志输出中看到提交和分支,并且从您的帖子中找不到您想要的方式。那么,你想要它怎么样?