Jak používat správce hesel pass s git repositářem (klíčenka)

Autor Hanz
Publikováno 28.03.2020 (update: 28.03.2020)
Kategorie Článek
O tom, jak jak používat správce hesel Pass se již na tomto webu psalo zde. Doplním, že správce hesel Pass (passwordstore.org) je možné používat kromě Linuxu i na Windows, iOS a klidně i na telefonech s Androidem či iPhone. Také je možné se rozhodnout zda chcete používat jen příkazy (CLI) nebo grafické rozhraní (GUI).

Nyní již k nastavení pass jako git repositáře s možností synchronizace mezi všemi zařízeními. Návod předpokládá, že máte nějaký git repositář na serveru (zde /home/git/repo/) a pass již máte inicializovaný.


Nastavení pass jako git repositáře


SERVER


# vytvoříme prázdný repositář password-store na serveru
git init --bare password-store

KLIENT


# inicializace git repositáře pro pass
pass git init
# nastavit vzdálený git repositář jako origin
pass git remote add origin user3@myserver:/home/git/repo/password-store
# pushnout lokální git repositář na server
pass git push -u --all


Použití pass s git repositářem


CLI


# před nastavováním nových hesel - pull (stáhnout ze serveru)
pass git pull
# po nastaveních nových hesel - push (nahrát na server)
pass git push

GUI - QtPass


Settings - zaškrtnou všechny volby v části Git
Programs - Native git/gpg
Grafickými šipkami se provádí git pull a git push

Možné chyby při nedodržení postupu výše


fatal: does not appear to be a git repository


pass git push -u --all
fatal: '/home/git/repo/.password-store' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

remote: error: refusing to update checked out branch: refs/heads/master


pass git push --set-upstream origin master
Enumerating objects: 10, done.
Counting objects: 100% (10/10), done.
Delta compression using up to 4 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 996 bytes | 996.00 KiB/s, done.
Total 6 (delta 3), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: is denied, because it will make the index and work tree inconsistent
remote: with what you pushed, and will require 'git reset --hard' to match
remote: the work tree to HEAD.
remote:
remote: You can set the 'receive.denyCurrentBranch' configuration variable
remote: to 'ignore' or 'warn' in the remote repository to allow pushing into
remote: its current branch; however, this is not recommended unless you
remote: arranged to update its work tree to match what you pushed in some
remote: other way.
remote:
remote: To squelch this message and still keep the default behaviour, set
remote: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To myserver:/home/git/repo/password-store
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'git@myserver:/home/git/repo/password-store'

error: remote unpack failed: unable to create temporary object directory


git push origin
Enumerating objects: 283, done.
Counting objects: 100% (283/283), done.
Delta compression using up to 4 threads
Compressing objects: 100% (148/148), done.
Writing objects: 100% (154/154), 63.08 KiB | 3.71 MiB/s, done.
Total 154 (delta 3), reused 0 (delta 0)
error: remote unpack failed: unable to create temporary object directory
To myserver:/home/git/repo/pass.git
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'git@myserver:/home/git/repo/pass.git'

PS: Pokud neumíte používat Git, dejte nahoře do vyhledávání slovo git ...


2

The English language is translated by machine - the translator can modify eg cited codes = it is better to use codes from the Czech original.

How to use password manager (pass) with git repository (keychain)

How to use Pass Password Manager has already been written here. I will add that Pass password manager (passwordstore.org) can be used in addition to Linux on Windows, iOS and even on phones with Android or iPhone. It is also possible to decide whether to use only commands (CLI) or graphical interface (GUI).

Now to set pass as a git repository with the ability to synchronize between all devices. The guide assumes that you have a git repository on your server (here / home / git / repo /) and you already have the pass initialized.


Set pass as git repository


SERVER


# create an empty password-store repository on the server
git init - bar password-store

CLIENT


# initialize the git repository for pass
pass git init
# set remote git repository as origin
pass git remote add user3 @ myserver:/home/git/repo/password-store
# push local git repository to server
pass git push -u --all


Using pass with git repository


CLI


# before setting new passwords - pull (download from server)
pass git pull
# after setting new passwords - push (upload to server)
pass git push

GUI - QtPass


Settings - check all Git options
Programs - Native git / gpg
Use the graphical arrows to perform git pull and git push

Possible errors if the above steps are not followed


fatal: does not appear to be a git repository


pass git push -u --all
fatal: '/home/git/repo/.password-store' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

remote: error: refusing to update checked out branch: refs/heads/master


pass git push --set-upstream origin master
Enumerating objects: 10, done.
Counting objects: 100% (10/10), done.
Delta compression using up to 4 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 996 bytes | 996.00 KiB/s, done.
Total 6 (delta 3), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: is denied, because it will make the index and work tree inconsistent
remote: with what you pushed, and will require 'git reset --hard' to match
remote: the work tree to HEAD.
remote:
remote: You can set the 'receive.denyCurrentBranch' configuration variable
remote: to 'ignore' or 'warn' in the remote repository to allow pushing into
remote: its current branch; however, this is not recommended unless you
remote: arranged to update its work tree to match what you pushed in some
remote: other way.
remote:
remote: To squelch this message and still keep the default behaviour, set
remote: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To myserver:/home/git/repo/password-store
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'git@myserver:/home/git/repo/password-store'

error: remote unpack failed: unable to create temporary object directory


git push origin
Enumerating objects: 283, done.
Counting objects: 100% (283/283), done.
Delta compression using up to 4 threads
Compressing objects: 100% (148/148), done.
Writing objects: 100% (154/154), 63.08 KiB | 3.71 MiB/s, done.
Total 154 (delta 3), reused 0 (delta 0)
error: remote unpack failed: unable to create temporary object directory
To myserver:/home/git/repo/pass.git
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'git@myserver:/home/git/repo/pass.git'
Vaše reakce na článek Jak používat správce hesel pass s git repositářem (klíčenka)

Napsat komentář k článku

Tento web používá soubory cookie. Dalším procházením tohoto webu vyjadřujete souhlas s jejich používáním.. Více informací zde.