Skip to content

Commit

Permalink
Small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor authored Sep 16, 2024
1 parent c993585 commit 888d023
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions docs/code-howtos/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ You probably chose the wrong gradle task.
### The problem

Sometimes, when contributing to JabRef, you may see `abbrv.jabref.org` or `csl-styles` or `csl-locales` among the changed files in your pull request. This means that you have accidentally committed your local submodules into the branch.

![Changed submodules](../images/submodules.png)

### Context
Expand All @@ -96,7 +97,7 @@ What's strange (mostly an IntelliJ bug): Regardless of CLI or GUI, These changes

For `csl-styles`:

```BASH
```bash
git merge origin/main
git checkout main -- src/main/resources/csl-styles
... git commit ...
Expand All @@ -109,29 +110,31 @@ And similarly for `csl-locales` or `abbrv.jabref.org`.

1. Edit `.gitmodules`: comment out `ignore = all` (for the respective submodules you are trying to reset)

```gitignore
# ignore = all
```
```gitignore
# ignore = all
```

2. `cd` into the changed submodules directory (lets say `csl-styles` was changed):

```BASH
cd src/main/resources/csl-styles
```
```bash
cd src/main/resources/csl-styles
```

3. Find the latest submodule commit id from remote (github):
![Submodule commits](../images/submodule-commit.png)
Here, in the case of `csl-styles`, it is `4e0902d`.

4. Checkout the commit:

```BASH
git checkout 4e0902d
```
```bash
git checkout 4e0902d
```

5. Now, IntelliJ's commit tab will notice that the submodules have been modified. This means we are on the right track.
6. Use IntelliJ's git manager (commit tab) or `git gui` to commit submodule changes only. Repeat steps 2-5 for other submodules that are shown as modified in the PR. Then, push these changes.

Now, the IntelliJ's commit tab will notice that the submodules have been modified. This means we are on the right track.
5. Use IntelliJ's git manager (commit tab) or `git gui` to commit submodule changes only. Repeat steps 2-5 for other submodules that are shown as modified in the PR. Then, push these changes.
6. Revert the changes in `.gitmodules` (that you made in step 1).
7. Revert the changes in `.gitmodules` (that you made in step 1).

### Prevention

Expand Down

0 comments on commit 888d023

Please sign in to comment.