mirror of
https://github.com/jbranchaud/til
synced 2026-01-16 13:38:02 +00:00
Compare commits
4 Commits
273c35318d
...
f538f3a7ab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f538f3a7ab | ||
|
|
e0db60f6ce | ||
|
|
5615da920f | ||
|
|
c60c63f554 |
11
README.md
11
README.md
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
|
||||
|
||||
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
||||
|
||||
_1518 TILs and counting..._
|
||||
_1519 TILs and counting..._
|
||||
|
||||
---
|
||||
|
||||
@@ -41,6 +41,7 @@ _1518 TILs and counting..._
|
||||
* [Internet](#internet)
|
||||
* [Java](#java)
|
||||
* [JavaScript](#javascript)
|
||||
* [jj](#jj)
|
||||
* [jq](#jq)
|
||||
* [Kitty](#kitty)
|
||||
* [Linux](#linux)
|
||||
@@ -190,7 +191,7 @@ _1518 TILs and counting..._
|
||||
- [Aliasing An Ansible Host](devops/aliasing-an-ansible-host.md)
|
||||
- [Allow Cross-Origin Requests To Include Cookies](devops/allow-cross-origin-requests-to-include-cookies.md)
|
||||
- [Allow HTTPS Through Your UFW Firewall](devops/allow-https-through-your-ufw-firewall.md)
|
||||
- [Check For Cached Site Assocation File For iOS](devops/check-for-cached-site-association-file-for-ios.md)
|
||||
- [Check For Cached Site Association File For iOS](devops/check-for-cached-site-association-file-for-ios.md)
|
||||
- [Check The Status of All Services](devops/check-the-status-of-all-services.md)
|
||||
- [Check The Syntax Of nginx Files](devops/check-the-syntax-of-nginx-files.md)
|
||||
- [Connect To An RDS PostgreSQL Database](devops/connect-to-an-rds-postgresql-database.md)
|
||||
@@ -569,6 +570,10 @@ _1518 TILs and counting..._
|
||||
- [Yarn Commands Without The Emojis](javascript/yarn-commands-without-the-emojis.md)
|
||||
- [Yup Schemas Are Validated Asynchronously](javascript/yup-schemas-are-validated-asynchronously.md)
|
||||
|
||||
### jj
|
||||
|
||||
- [Colocate jj And git Directories For Project](jj/colocate-jj-and-git-directories-for-project.md)
|
||||
|
||||
### jq
|
||||
|
||||
- [Combine An Array Of Objects Into A Single Object](jq/combine-an-array-of-objects-into-a-single-object.md)
|
||||
@@ -724,7 +729,7 @@ _1518 TILs and counting..._
|
||||
- [Check If Clusters Are Upgrade Compatible](postgres/check-if-clusters-are-upgrade-compatible.md)
|
||||
- [Check If The Local Server Is Running](postgres/check-if-the-local-server-is-running.md)
|
||||
- [Check If User Role Exists For Database](postgres/check-if-user-role-exists-for-database.md)
|
||||
- [Check Table For Any Oprhaned Records](postgres/check-table-for-any-orphaned-records.md)
|
||||
- [Check Table For Any Orphaned Records](postgres/check-table-for-any-orphaned-records.md)
|
||||
- [Checking Inequality](postgres/checking-inequality.md)
|
||||
- [Checking The Type Of A Value](postgres/checking-the-type-of-a-value.md)
|
||||
- [Clear The Screen In psql](postgres/clear-the-screen-in-psql.md)
|
||||
|
||||
59
jj/colocate-jj-and-git-directories-for-project.md
Normal file
59
jj/colocate-jj-and-git-directories-for-project.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# Colocate jj And git Directories For Project
|
||||
|
||||
When doing a standard clone of a git repository with `jj`, you'll get a copy of
|
||||
the project with a `.jj` directory containing the version control information.
|
||||
|
||||
```bash
|
||||
$ jj git clone git@github.com:jbranchaud/my-repo
|
||||
Fetching into new repo in "/path/of/local/repo"
|
||||
...
|
||||
|
||||
$ exa --tree --all -L 1
|
||||
.
|
||||
├── .gitignore
|
||||
├── .jj
|
||||
├── Cargo.lock
|
||||
├── Cargo.toml
|
||||
└── src
|
||||
```
|
||||
|
||||
This is fine if I'm completely familiar with using
|
||||
[jujutsu](https://martinvonz.github.io/jj/latest/). However, if I'm coming from
|
||||
`git` and still learning, then it would be nice to be able to fallback to
|
||||
familiar `git` commands when needed.
|
||||
|
||||
But without a `.git` directory, I get this:
|
||||
|
||||
```bash
|
||||
$ git log
|
||||
fatal: not a git repository (or any of the parent directories): .git
|
||||
```
|
||||
|
||||
When cloning a git repo with `jj`, I can instruct it to _colocate_ which means
|
||||
that it will create both the `.jj` and the `.git` data directories in the
|
||||
project.
|
||||
|
||||
```bash
|
||||
$ jj git clone --colocate git@github.com:jbranchaud/my-repo
|
||||
Fetching into new repo in "/path/of/local/repo"
|
||||
...
|
||||
|
||||
$ exa --tree --all -L 1
|
||||
.
|
||||
├── .git
|
||||
├── .gitignore
|
||||
├── .jj
|
||||
├── Cargo.lock
|
||||
├── Cargo.toml
|
||||
└── src
|
||||
```
|
||||
|
||||
Now I can run `jj` commands or `git` commands:
|
||||
|
||||
```bash
|
||||
$ git log
|
||||
commit 0c72abbb83657096677f9a3d5ddc7bce20839165 (HEAD, origin/trunk, trunk)
|
||||
...
|
||||
```
|
||||
|
||||
[source](https://martinvonz.github.io/jj/latest/git-compatibility/#co-located-jujutsugit-repos)
|
||||
Reference in New Issue
Block a user