How to get GIT repository URL from source folder

·1 min. read·

There are several ways to get the link to a GIT repository from the directory where the repository was previously cloned. Let's explore each of them:

  1. Command git config --get remote.origin.url
https://github.com/geekrainian/next-app.git
  1. Command git remote -v
origin  https://github.com/geekrainian/next-app.git (fetch)
origin  https://github.com/geekrainian/next-app.git (push)
  1. Command git remote show origin
* remote origin
  Fetch URL: https://github.com/geekrainian/next-app.git
  Push  URL: https://github.com/geekrainian/next-app.git
  HEAD branch: master
  1. Check the hidden .git/config file manually or use the command cat .git/config
[core]
	repositoryformatversion = 0
	filemode = false
	bare = false
	logallrefupdates = true
	symlinks = false
	ignorecase = true
[remote "origin"]
	url = https://github.com/geekrainian/next-app.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master

You may also like

How to use PM2 with Node.js
PM2 is a tool for managing Node.js processes, allowing for application... Read more
·2 min. read
How to install Node.js on Ubuntu 20.04
As an example, I use VPS hosting with pre-installed Ubuntu 20.04.3 LTS. Keep in... Read more
·2 min. read
Lineage 2 game disc boxes look and feel
Since the original boxes with Lineage 2 game discs never appeared in the CIS... Read more
·2 min. read

© geekrainian.com