The Daily Shaarli

All links of one day in a single page.

Today - 11/14/25

ssh-keygen
ssh-keygen -t ed25519 -C "comment" # generate a keys pair with protocol ed25519 (better than rsa)
github

TRICKS

create a local git repository and publish it to github

  • create the repo on github
  • on local repo:
    cd <my_local_repo>
    git init
    echo "# <my_local_repo>" >> README.md
    git commit -m "first commit: Initialize repo"
    git co main
    git remote add [-t <branch>] -m main [--mirror=(fetch|push)] <name> <URL>
    # git remote add -m main github git@github.com:aguytech/docker_alpine-alias.git
    git remote -v
    git push -u <name> main # for only main
    git push --all -u <name> main # for all branches
    # git push -u github main

connection with ssh

  1. import public key to github
  2. test
    ssh -T -i $private_key_file git@github.com # test ssh connection
    ssh -T -i $private_key_file -p 443 git@ssh.github.com # test ssh connection over https
    ssh-add $private_key_file # avoids the repeated entry of secret phrases
  3. set the default key
    git config --global user.signingkey $privaye_key_file # for ssh
  4. test with git command
    GIT_SSH_COMMAND="ssh -i $privaye_key_file -vvv" git pull

change remote url for remote existing repository

git remote -v # print https://github.com/user/project
git remote set-url origin git@github.com:user/project.git # change the connection url to use ssh
git remote -v # print git@github.com:user/project.git

delete tags

git tag -d [tag];
git push origin :[tag]
git tag -d [tag]
git push origin :refs/tags/[tag]

create orphan repo from another

Create origin to remote server

repo_local="shaarli-snippets"
tmp_branch="dev"

origin="github"
url_origin="git@github.com:aguytech/Shaarli-snippets.git"

upstream="shaarli"
url_upstream="git@github.com:aguytech/Shaarli.git"
upstream_branch="v0.11-snippets" # remote branch to track

mkdir -p "$repo_local"
cd "$repo_local"

git init

# remote
git remote add "$origin" "$url_origin"
git remote add -t "$upstream_branch" "$upstream" "$url_upstream"
git remote -v
git config --get-regexp '^remote'

# upstream
git fetch "$upstream"
git co --orphan="$tmp_branch" "$upstream"/"$upstream_branch"
git st
git ci -m "Initialize branch from $upstream/$upstream_branch $(git log --pretty=format:'%h' -n 1 "$upstream"/"$upstream_branch")"

# origin
git push --set-upstream "$origin" "$tmp_branch"
git co -b master
git push --set-upstream "$origin" master
git br -vv
git br -rlv github/*

# archive
git archive --format tar.gz -9 -o "master.$(date +%s).tar.gz" master