I have so far seen that the git remote is on network. Is it possible for it to be a location on the computer itself like another drive or another directory? If so, how?
https://git-scm.com/docs/git-pull#_git_urls
For local repositories, also supported by Git natively, the following syntaxes may be used:
/path/to/repo.git/
file:///path/to/repo.git/
Yes. For local repositories, a remote can be a relative path or an absolute path to another local folder. Besides, it can be in the syntax file:///path/to/folder. And here are more facts about the remote.
A remote can be a git bundle, as a read-only one.
git init /path/to/foo
cd /path/to/foo
touch a.txt
git add .
git commit -mfoo
git bundle create /path/to/foo.bundle master
git init /path/to/bar
cd /path/to/bar
git remote add origin /path/to/foo.bundle
# it's possible to fetch data from the bundle
git fetch origin master
git checkout master
# it's not possible to push data to the bundle
# git push fails
A remote can be the repository itself.
git init /path/to/foo
cd /path/to/foo
touch a.txt
git add .
git commit -mfoo
# add a remote which is the repository itself
git remote add origin .
# or
git remote add origin /path/to/foo
# push "master" to create a new branch "new_master"
git push origin master:new_master
A remote can be any repository which is accessible from the current repository, even if the two repositories are completely different.
git clone https://github.com/arobson/rabbot
cd rabbot
git remote add new https://github.com/fooplugins/FooTable
git fetch new
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With