Skip to content

Instantly share code, notes, and snippets.

@achilleas-k
Last active September 30, 2016 10:21
Show Gist options
  • Save achilleas-k/5d29b911fb0765e206afd904d1d5a182 to your computer and use it in GitHub Desktop.
Save achilleas-k/5d29b911fb0765e206afd904d1d5a182 to your computer and use it in GitHub Desktop.

▶ gin

Usage:
        gin login    [<username>]
        gin create   [<name>] [-d <description>]
        gin upload   [<path>]
        gin download [<path>]
        gin repos    [<username>]
        gin info     [<username>]
        gin keys     [-v | --verbose]
        gin keys add
        gin public

▶ gin login achilleas
...

[Login success] You are now logged in as achilleas
You have been granted the following permissions: account-read, account-write, repo-read, repo-write

▶ gin create testannex

▶ gin repos

Repositories owned by achilleas
1:  dfjhk
2:  foo
3:  foobar
4:  testannex

▶ ssh koutsou@gin.g-node.org ls -l /data/repos/git/achilleas/

total 16
drwxr-xr-x 8 git  git  4096 Sep 28 17:47 dfjhk.git
drwxr-xr-x 8 git  git  4096 Sep 28 17:43 foobar.git
drwxr-xr-x 8 git  git  4096 Sep 28 17:42 foo.git
drwxr-xr-x 8 root root 4096 Sep 30 11:37 testannex.git

▶ # Fixed (chown) on server

▶ ssh koutsou@gin.g-node.org ls -l /data/repos/git/achilleas/

total 16
drwxr-xr-x 8 git git 4096 Sep 28 17:47 dfjhk.git
drwxr-xr-x 8 git git 4096 Sep 28 17:43 foobar.git
drwxr-xr-x 8 git git 4096 Sep 28 17:42 foo.git
drwxr-xr-x 8 git git 4096 Sep 30 11:37 testannex.git

▶ git clone git@gin.g-node.org:achilleas/testannex

Cloning into 'testannex'...
uid: achilleas
cmd: git-upload-pack [achilleas/testannex]
warning: You appear to have cloned an empty repository.

▶ cd testannex

▶ tree .git

.git
├── branches
├── config
├── description
├── HEAD
├── hooks
│   ├── applypatch-msg.sample
│   ├── commit-msg.sample
│   ├── post-update.sample
│   ├── pre-applypatch.sample
│   ├── pre-commit.sample
│   ├── prepare-commit-msg.sample
│   ├── pre-push.sample
│   ├── pre-rebase.sample
│   ├── pre-receive.sample
│   └── update.sample
├── info
│   └── exclude
├── objects
│   ├── info
│   └── pack
└── refs
    ├── heads
    └── tags

9 directories, 14 files

▶ git annex info

git-annex: First run: git-annex init
CallStack (from HasCallStack):
  error, called at ./Annex/Init.hs:131:27 in main:Annex.Init

▶ echo "This is a test repositody" > README.md

▶ git add README.md

▶ git commit -m "Adding readme"

[master (root-commit) d74deac] Adding readme
 1 file changed, 1 insertion(+)
 create mode 100644 README.md

▶ git push

uid: achilleas
cmd: git-receive-pack [achilleas/testannex]
Counting objects: 3, done.
Writing objects: 100% (3/3), 243 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To gin.g-node.org:achilleas/testannex
 * [new branch]      master -> master

▶ ssh koutsou@gin.g-node.org tree /data/repos/git/achilleas/testannex.git/

/data/repos/git/achilleas/testannex.git/
├── branches
├── config
├── description
├── gin
├── HEAD
├── hooks
│   ├── applypatch-msg.sample
│   ├── commit-msg.sample
│   ├── post-update.sample
│   ├── pre-applypatch.sample
│   ├── pre-commit.sample
│   ├── prepare-commit-msg.sample
│   ├── pre-push.sample
│   ├── pre-rebase.sample
│   └── update.sample
├── info
│   └── exclude
├── objects
│   ├── c9
│   │   └── fd8db13b2a9d67318c34e8d1359f6544698fd6
│   ├── d7
│   │   └── 4deac05fc17ee6a9687b9dbb3c0dea05585f1e
│   ├── ff
│   │   └── a545e978bd6b9fbf36f025e81d271368d38de1
│   ├── info
│   └── pack
└── refs
    ├── heads
    │   └── master
    └── tags

13 directories, 17 files

▶ dd if=/dev/urandom of=test.rnd bs=1M count=4

4+0 records in
4+0 records out
4194304 bytes (4.2 MB, 4.0 MiB) copied, 0.246921 s, 17.0 MB/s

▶ ll

total 4.1M
-rw-r----- 1 achilleas achilleas   26 Sep 30 11:41 README.md
-rw-r----- 1 achilleas achilleas 4.0M Sep 30 11:43 test.rnd

▶ git annex add test.rnd

git-annex: First run: git-annex init
CallStack (from HasCallStack):
  error, called at ./Annex/Init.hs:131:27 in main:Annex.Init

▶ git annex init

init  uid: achilleas
cmd: git-annex-shell [configlist /~/achilleas/testannex]
[E] repo access error: Server returned non-OK status: 400
uid: achilleas
cmd: git-upload-pack [achilleas/testannex]

  Remote origin does not have git-annex installed; setting annex-ignore

  This could be a problem with the git-annex installation on the remote. Please make sure that git-annex-shell is available in PATH when you ssh into the remote. Once you have fixed the git-annex installation, run: git annex enableremote origin
ok
(recording state in git...)

▶ git annex info

repository mode: indirect
trusted repositories: 0
semitrusted repositories: 3
        00000000-0000-0000-0000-000000000001 -- web
        00000000-0000-0000-0000-000000000002 -- bittorrent
        f112ed7d-b458-4658-8a7e-356f1eb06ac6 -- achilleas@Tessa:~/tmp/gin/testannex [here]
untrusted repositories: 0
transfers in progress: none
available local disk space: 4.08 gigabytes (+1 megabyte reserved)
local annex keys: 0
local annex size: 0 bytes
annexed files in working tree: 0
size of annexed files in working tree: 0 bytes
bloom filter size: 32 mebibytes (0% full)
backend usage:

▶ git annex sync --content

commit
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
        test.rnd

nothing added to commit but untracked files present
ok
pull origin
uid: achilleas
cmd: git-upload-pack [achilleas/testannex]
ok
push origin
uid: achilleas
cmd: git-receive-pack [achilleas/testannex]
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (5/5), 479 bytes | 0 bytes/s, done.
Total 5 (delta 0), reused 0 (delta 0)
To gin.g-node.org:achilleas/testannex
 * [new branch]      git-annex -> synced/git-annex
 * [new branch]      master -> synced/master
ok

▶ git status

On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        test.rnd

nothing added to commit but untracked files present (use "git add" to track)

▶ git annex add test.rnd

add test.rnd ok
(recording state in git...)

▶ git status

On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        new file:   test.rnd

▶ git commit -m "Adding test file"

[master 9067cb5] Adding test file
 1 file changed, 1 insertion(+)
 create mode 120000 test.rnd

▶ git push

uid: achilleas
cmd: git-receive-pack [achilleas/testannex]
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 388 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To gin.g-node.org:achilleas/testannex
   d74deac..9067cb5  master -> master

▶ git annex sync --content

commit
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
ok
pull origin
uid: achilleas
cmd: git-upload-pack [achilleas/testannex]
ok
push origin
uid: achilleas
cmd: git-receive-pack [achilleas/testannex]
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 496 bytes | 0 bytes/s, done.
Total 5 (delta 0), reused 0 (delta 0)
To gin.g-node.org:achilleas/testannex
   66d124e..c468c9a  git-annex -> synced/git-annex
   d74deac..9067cb5  master -> synced/master
ok

▶ git annex info

repository mode: indirect
trusted repositories: 0
semitrusted repositories: 3
        00000000-0000-0000-0000-000000000001 -- web
        00000000-0000-0000-0000-000000000002 -- bittorrent
        f112ed7d-b458-4658-8a7e-356f1eb06ac6 -- achilleas@Tessa:~/tmp/gin/testannex [here]
untrusted repositories: 0
transfers in progress: none
available local disk space: 4.08 gigabytes (+1 megabyte reserved)
local annex keys: 1
local annex size: 4.19 megabytes
annexed files in working tree: 1
size of annexed files in working tree: 4.19 megabytes
bloom filter size: 32 mebibytes (0% full)
backend usage:
        SHA256E: 1

▶ git annex whereis test.rnd

whereis test.rnd (1 copy)
        f112ed7d-b458-4658-8a7e-356f1eb06ac6 -- achilleas@Tessa:~/tmp/gin/testannex [here]
ok

▶ git annex enableremote

git-annex: Specify the remote to enable.
        origin
(No special remotes are currently known; perhaps use initremote instead?)
CallStack (from HasCallStack):
  error, called at ./Command/EnableRemote.hs:97:9 in main:Command.EnableRemote

▶ git annex enableremote origin

enableremote origin uid: achilleas
cmd: git-annex-shell [configlist /~/achilleas/testannex]
[E] repo access error: Server returned non-OK status: 400
uid: achilleas
cmd: git-upload-pack [achilleas/testannex]

  Remote origin does not have git-annex installed; setting annex-ignore

  This could be a problem with the git-annex installation on the remote. Please make sure that git-annex-shell is available in PATH when you ssh into the remote. Once you have fixed the git-annex installation, run: git annex enableremote origin
failed
git-annex: enableremote: 1 failed
CallStack (from HasCallStack):
  error, called at ./CmdLine/Action.hs:41:28 in main:CmdLine.Action
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment