mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-29 14:00:31 +08:00
cli: Improve rad remote add
By default, this command now: * Follows the peer if not already followed * Syncs refs of the peer, if it wasn't followed before * Fetches refs into working copy This functionality can be disabled via `--no-sync` and `--no-fetch`.
This commit is contained in:
@@ -7,9 +7,6 @@ First we add a second delegate, Bob, to our repo:
|
||||
``` ~alice
|
||||
$ rad id update --title "Add Bob" --description "" --delegate did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji -q
|
||||
c036c0d89ce26aef3ad7da402157dba16b5163b4
|
||||
$ rad remote add did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
|
||||
✓ Remote bob@z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk added
|
||||
✓ Remote-tracking branch bob@z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk/master created for z6Mkt67…v4N1tRk
|
||||
```
|
||||
|
||||
Then, as Bob, we commit some code on top of the canonical head:
|
||||
@@ -32,7 +29,9 @@ As Alice, we fetch that code, but commit on top of our own master, which is no
|
||||
longer canonical, since Bob pushed a more recent commit, and the threshold is 1:
|
||||
|
||||
``` ~alice
|
||||
$ git fetch bob@z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
|
||||
$ rad remote add did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk --fetch --no-sync
|
||||
✓ Remote bob@z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk added
|
||||
✓ Remote-tracking branch bob@z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk/master created for z6Mkt67…v4N1tRk
|
||||
$ git branch -arv
|
||||
bob@z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk/master 319a7dc Third commit
|
||||
rad/master f2de534 Second commit
|
||||
|
||||
Reference in New Issue
Block a user