Index:


Git and similar

  • Gitea admin tips and tricks…

    I recently started having issues with my Yubikey / Security Key that I use for Gitea, and was unable to login.

    This explains how to fix it.

    Connect to the database. I only have a single user, and so I use the sqlite3 database backend.

    $ sqlite3 gitea.db
    
    sqlite> select id from user where name="wkumari";
    sqlite> delete from u2f_registration where user_id =1;
    

    This still didn’t work — and then I noticed that the url ended in ‘webauthn’, so I also did:

    $ sqlite3 gitea.db
    
    sqlite> select * from webauthn_credential;
    sqlite> delete delete from webauthn_credential where id=2;
    

    Done!

  • Sync’ing a git / GitHub fork.

    I need to do this fairly frequently, and for some reason I can never remember the steps, so I’m writing it down!

    This isn’t news, it is lifted from the GitHub Configuring a remote for a fork and Syncing a fork pages.

    $ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git

    $ git fetch upstream
    $ git checkout master
    $ git merge upstream/master

    Make your edits, etc. Push (this will push to your fork), make pull-request. Next time you need to sync the orogin, start at the ‘git fetch upstream‘ step.

     

  • Migrating from SVN to Git

    There are already a number of online instructions on how to do this, but many of them required much reading and assumed specific SVN repo layouts. 

    I used SVN for various small projects, and didn’t follow the standard trunk layout. I also wanted to break up my huge SVN repo into lots of smaller git repos. 

    Here is my cheat sheet:

     # mkdir ansible 
    # cd ansible
    # svn2git svn+ssh://svn.kumari.net/data/svn/my_configs/ansible --trunk / \
    --authors ~/src/code/users.txt --no-minimize-url
    # git remote add origin git@git.kumari.net:config_ansible
    # git push --set-upstream origin master