When you are working in some Git directory, how can you get the Git repository name in some Git repository? Are there any Git commands?
# I did check out bar
This approach using git-remote worked well for me for HTTPS remotes:
git-remote
$ git remote -v | grep "(fetch)" | sed 's/.*\/\([^ ]*\)\/.*/\1/' | | | | | | | +---------------+ | | | Extract capture | | +--------------------+-----+ |Repository name capture| +-----------------------+
Example