From 19ad80de2254d5cf9f9ef4b3458f3cf8a0b2245d Mon Sep 17 00:00:00 2001 From: "branchable@bafd175a4b99afd6ed72501042e364ebd3e0c45e" Date: Thu, 28 May 2020 16:25:27 +0000 Subject: [PATCH 1/2] --- ..._trying_to_push_to_checked_out_branches__63__.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/forum/Is_it_possible_to_stop_annex_sync_from_trying_to_push_to_checked_out_branches__63__.mdwn diff --git a/doc/forum/Is_it_possible_to_stop_annex_sync_from_trying_to_push_to_checked_out_branches__63__.mdwn b/doc/forum/Is_it_possible_to_stop_annex_sync_from_trying_to_push_to_checked_out_branches__63__.mdwn new file mode 100644 index 0000000000..28448932dc --- /dev/null +++ b/doc/forum/Is_it_possible_to_stop_annex_sync_from_trying_to_push_to_checked_out_branches__63__.mdwn @@ -0,0 +1,11 @@ +I'm using git annex sync to keep the `master` branch of various remotes in sync. Predictably, while the `synced/master` branch gets synced fine, the machine running git annex sync fails to push to the remote's `master` branch, since it's currently checked out: + + ok + push indian + Everything up-to-date + remote: error: refusing to update checked out branch: refs/heads/master + To ssh://indian-wired/home/adam/org + ! [remote rejected] master -> master (branch is currently checked out) + error: failed to push some refs to 'ssh://adam@indian-wired/home/adam/org' + +Is there a way to get annex sync to only try to push to the remote's `synced/master` and not `master`? I see the `--no-push` option, but presumably this would prevent pushing to both, which is obviously not what I want. From 8b280d4d8a80f6b70b280954c23bae78225794d0 Mon Sep 17 00:00:00 2001 From: kyle Date: Thu, 28 May 2020 17:55:11 +0000 Subject: [PATCH 2/2] Added a comment --- ...1_e74ddd1bf47f856369568b1fcd8d4f9c._comment | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 doc/forum/Is_it_possible_to_stop_annex_sync_from_trying_to_push_to_checked_out_branches__63__/comment_1_e74ddd1bf47f856369568b1fcd8d4f9c._comment diff --git a/doc/forum/Is_it_possible_to_stop_annex_sync_from_trying_to_push_to_checked_out_branches__63__/comment_1_e74ddd1bf47f856369568b1fcd8d4f9c._comment b/doc/forum/Is_it_possible_to_stop_annex_sync_from_trying_to_push_to_checked_out_branches__63__/comment_1_e74ddd1bf47f856369568b1fcd8d4f9c._comment new file mode 100644 index 0000000000..0dc0892433 --- /dev/null +++ b/doc/forum/Is_it_possible_to_stop_annex_sync_from_trying_to_push_to_checked_out_branches__63__/comment_1_e74ddd1bf47f856369568b1fcd8d4f9c._comment @@ -0,0 +1,18 @@ +[[!comment format=mdwn + username="kyle" + avatar="http://cdn.libravatar.org/avatar/7d6e85cde1422ad60607c87fa87c63f3" + subject="comment 1" + date="2020-05-28T17:55:10Z" + content=""" +I don't think there's a way to do that. I think your main options are + + * set `receive.denyCurrentBranch` to \"updateInstead\" or + + * handle the pushing and fetching yourself. Follow up with a `git + annex merge` or with a `git annex sync` invocation that prevents + it from pushing/pulling. + + I haven't used it myself, but my understanding is that `sync`s + recently added `--only-annex` is intended to support this case and + frees you from worrying about managing git-annex branches. +"""]]