I have set up an annex on a remote machine and I am connecting via ssh. But, since it is a managed machine, I installed the git-annex binary in my own ~/bin. Well, when I try $git annex sync
I get: $git annex sync (merging origin/git-annex into git-annex...) (Recording state in git...) bash: git-annex-shell: command not found
Remote origin does not have git-annex installed; setting annex-ignore commit ok pull origin
merge: refs/remotes/origin/master - not something we can merge
merge: refs/remotes/origin/synced/master - not something we can merge failed git-annex: sync: 1 failed
The git remote -v looks correct. So, how do I tell git annex on my local machine where to use $HOME/bin in PATH on the remote machine when syncing with remotes?
If i don't misremember some systems including Debian require you to set the path on the very first line of .bashrc for it to work. Can't remember why just now.
in other words paste the following into the very first line of
$HOME/.bashrc
PATH=$PATH:$HOME/bin:$HOME/bin/git-annex.linux
Modify the line above if you haven't installed to
~/bin/git-annex.linux
"I now realize that the git annex system still requires the standard "add" and "commit" process. But I'm still getting:
$git annex sync commit ok pull origin remote: Counting objects: 37, done. remote: Compressing objects: 100% (35/35), done. remote: Total 36 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (36/36), done. From ssh://stampede.tacc.utexas.edu/work/02463/srinathv/cesm1_3_beta07/scripts * [new branch] master -> origin/master
merge: refs/remotes/origin/synced/master - not something we can merge failed push origin Counting objects: 11, done. Delta compression using up to 4 threads. Compressing objects: 100% (6/6), done. Writing objects: 100% (8/8), 736 bytes | 0 bytes/s, done. Total 8 (delta 3), reused 1 (delta 0) To ssh://srinathv@stampede.tacc.utexas.edu/work/02463/srinathv/cesm1_3_beta07/scripts * [new branch] git-annex -> synced/git-annex * [new branch] master -> synced/master ok git-annex: sync: 1 failed
So the fails appear, and the suggestion of "export PATH" placement did not help, though appreciated.
@Srinath I wonder if the machine you are running git-annex sync on is a Windows machine? I have seen that " refs/remotes/origin/synced/master - not something we can merge" intermittently when testing on Windows, but not other times.
(It's not related to the original PATH configuration problem on your server.)
I have a similar issue on MacOS with git-annex installed via homebrew.
I'm trying to do
git annex sync macbook-remote
which is setup as a remote pointing tossh://macbook-remote:/Users/me/annex
.I get the messages:
I have confirmed git-annex is installed on the remote machine, and
which git-annex
andwhich git-annex-shell
both show the binaries in the/usr/local/bin/
directory.I tried to fix it by setting the path in
~/.zprofile
of the remote machine:PATH=$PATH:/usr/local/bin/git-annex-shell
Then I rangit annex enableremote macbook-remote
on the local machine. This doesn't seem to work. It gives the same error. I also tried changing the path in the.zshrc
even though from my understanding I should be setting the.zprofile
one. Am I doing it wrong?What confuses me is why there is a message about parsing the git config. The message is not clear which git config it is talking about. Does this mean there is an issue with the
~/.gitconfig
file? Maybe it is referring to the~/annex/.git/config
file instead? Maybe the shell issue is not the only problem here.Toggling verbosity / debug with the
--verbose --debug
flags doesn't seem to give any extra information to identify which file it's having problems parsing.Any insight is appreciated.
Thanks
As a solution to my own question, for anyone who stumbles upon this with the same problem... You don't have to set the path on the remote machine to get this working.
On the local machine, simply do:
git config remote.macbook-remote.annex-shell /usr/local/bin/git-annex-shell
Then do:git annex enableremote macbook-remote
Finally,git annex sync macbook-remote
to sync it with the remote one.See: https://git-annex.branchable.com/tips/get_git-annex-shell_into_PATH/
I don't think this really fixed whatever weirdness is going on with the remote, but thankfully the tip works.