Skip to content

Commit

Permalink
docs/git-compatibility.md: preserve working copy files when co-locating
Browse files Browse the repository at this point in the history
Use `jj new && jj undo` instead of `jj new @-` at the end of converting to a
co-located repository, because the latter "stashes" newly added working copy
changes into a sibling commit.

See also: #4945

Signed-off-by: Tim Janik <[email protected]>
  • Loading branch information
tim-janik committed Nov 22, 2024
1 parent d5bf148 commit 13abedc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/git-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,16 @@ technically possible (though not officially supported) to convert it into a
co-located repo like so:

```bash
# Ignore the .jj directory in Git
echo '/*' > .jj/.gitignore
# Move the Git repo
mv .jj/repo/store/git .git
# Tell jj where to find it
echo -n '../../../.git' > .jj/repo/store/git_target
# Ignore the .jj directory in Git
echo '/*' > .jj/.gitignore
# Make the Git repository non-bare and set HEAD
git config --unset core.bare
jj new @-
# Convince jj to update .git/HEAD to point to the working-copy commit's parent
jj new && jj undo
```

We may officially support this in the future. If you try this, we would
Expand Down

0 comments on commit 13abedc

Please sign in to comment.