proto/org/git.org
2019-01-26 15:40:07 -08:00

3.1 KiB
Raw Blame History

Git

Intro

The purpose of this channel is (currently) to draft a git workflow for serge / projex.

ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key.pub

Git Workflow

on server

  • cd /srv/git && su - git
  • mkdir projex/repo.git && cd repo.git && git init bare

on local computer

  • torsocks git clone git@w2ja5hhrcjc2wnxe.onion:projex/repo.git

    • this requires that you have a pubkey added to srv/git/.ssh/authorized_keys
    • see /var/www/irc.anarchyplanet.org/dox for an example of this locally (git remote -v)
    • you will clone an empty repo… make changes locally and then push
  • make changes locally
  • torsocks git push origin master

random notes

branch issues with git push

I don't have permissions figured out perfectly for this. when I push as notnull@host it hangs (permission issue) but when I push as root it's fine. also when I push as notnull@serge.

notnull is part of group git.

I need to examine permissions for /srv/git on the other hand… why would sudo git push work? doesn't that indicate that it's a local permissions problem? ^ possibly confirmed? I just pushed from Pi without a problem…

Does srv/git/projex/proto need to be owned by notnull? does the push need to happen as git user? https://en.wikibooks.org/wiki/Git/Gitosis#Defining_Groups,_Members,_Permissions,_and_Repositories https://wiki.archlinux.org/index.php/Gitosis#Repositories_and_permissions ^ /kickban anon < RTFM

ideal workflow: branches

Ideally, users would checkout their own branch and push that branch to the main repo, but I don't know if I have a way to protect the master branch without using GitHub. I assume there is a way by controlling permissions somewhere in the bare repo, but I haven't found it yet.

*

gitk

*

notnull@serge:~$ gitk application-specific initialization failed: no display name and no $DISPLAY environment variable Error in startup script: no display name and no $DISPLAY environment variable while executing "load /usr/lib/x86_64-linux-gnu/libtk8.6.so Tk" ("package ifneeded Tk 8.6.6" script) invoked from within "package require Tk" (file "/usr/bin/gitk" line 10)

*

old notes These notes are not currently correct, but they are for reference.

*

To gain SSH access to server generate an SSH key: http://pad.anarchistnews.org/p/ssh and send to admin to ssh into serge: torify ssh (username@)iofdnzyvag7ncw63.onion

To create a git repository in your realm on mudbox:

  • ssh into mudbox
  • cd realm
  • git init
  • git config global user.email "<username>@serge"
  • git config global user.name "<username>"
  • git add -A
  • git commit -m "import"
  • exit

on home computer:

  • torsocks git clone <username>@mudbox.onion:realm
  • cd realm
  • git config global user.email "<username>@serge"
  • git config global user.name "<username>"
  • nano README.md
  • type Hello, world! ; save and exit
  • git add -A
  • git commit -m "first commit"
  • torsocks git push origin master