Get Git repo url using absolute path
13,080
git --git-dir=/home/username/myFolder/.git config --get remote.origin.url
Author by
Ionică Bizău
💻 Programmer ⚡️ Geek 🎹 Pianist & Organist 🚀 Learner 💡 Mentor 💫 Dreamer 🍏 Vegetarian 🙏 Jesus follower Website | GitHub | Twitter | PayPal Donations
Updated on June 11, 2022Comments
-
Ionică Bizău almost 2 years
I can get the repository path running the following command in the repository folder (like it was suggested here):
git config --get remote.origin.url
How can I get the git repository url using an absolute path?
Suppose that I am in another folder and I want to get the repository url from another folder, using an absolute path.
I tried this, but doesn't work.
git config --get remote.origin.url --path /home/username/myFolder
-
Ionică Bizău over 10 yearsGood, but not complete. The
.git
folder has to be added after--git-dir
path, like here. I edited your answer. -
forivall over 10 yearsYeah, I just typed that in from memory, not remembering that it needs the bare repo (the .git folder). Thanks!
-
Abdulla Nilam almost 6 yearsNice and clean.