paulirish/git-open

git-open not open SSH repository url

farghly opened this issue · 4 comments

git-open open http and https URL only but it's not open SSH URL , How to fix that to open SSH URL?

Same issue here, it would be awesome to fix this !

I don't understand or is this already fixed?

I've some repos with URI origin git@gitlab.com:…, which are shown as https://gitlab.com/… with git-open -p.

git-open will open these repositories as well (in my case). So what's exactly the problem?

I installed the updated version and it is working correctly. thanks @thomasmerz

@farghly , FYI: one of my digital lifehacks for keeping all my GitHub/GitLab repos uptodate:
~/bin/gitfetchall_and_gitpullall_subdirs.sh

#!/bin/bash
# shellcheck disable=SC2010

function do_the_git_stuff () {
  git fetch -p
  git pull|grep -v "Already up to date."
  git gc --auto -q
  cd .. || exit
}

function work_on_dirs () {
for d in $(ls -l | grep ^d | awk '{print $9}' 2>/dev/null | sort); do
  # n is the n-th level of dirs:
  # 0 means "main" and 1, 2, ... are sub-dirs of "main" dir.
  [ "$n" -eq "0" ] && echo -e "\033[1;32mMain: $d\033[0m" || echo -e "\033[1;33mSub: $d\033[0m"
  cd "$d" || exit
  ### TODO: nice and efficient(?) way to get only git-repo-directories:
  ### find . -type d -name .git -prune | xargs -I= sh -c "cd =/..; pwd"
  if [ -d ".git" ]; then
    do_the_git_stuff
  else
    n=$(( n + 1))
    work_on_dirs $n
    n=0
    cd .. || exit
  fi
  #cd "$DIR"
  [ "$n" -eq "0" ] && echo ""
done
}

DIR=$(pwd)
n=0
if [ -d ".git" ]; then
  echo -e "\n\033[1;31m### This script pulls only this current (git) directory ###\033[0m\n"
  do_the_git_stuff
else
  echo -e "\n\033[1;31m### This script pulls all git directory structures recursively ###\033[0m\n"
  work_on_dirs
fi
cd "$DIR" || exit

You can find some more interesting git-tools in my repo.