How to git clone a repo in windows from other pc within the LAN?
To access the repo, you must either share it on 192.168.0.6
or must be the same domain user as the one that owns the file on 192.168.0.6
.
If you share the directory on 192.168.0.6
(e.g. with share name myrepo
), you access it with //192.168.0.6/myrepo
.
If you are logged in on your box with a user accout that is known on 192.168.0.6
, you could try accessing the repo through the administrative shares:
//192.168.0.6/c$/xampp/htdocs/...
Always use forward slashes.
Another alternative would be using SSH to access the remote machine.
GIT clone repo across local file system in windows
You can specify the remote’s URL by applying the UNC path to the file protocol. This requires you to use four slashes:
git clone file:////<host>/<share>/<path>
For example, if your main machine has the IP 192.168.10.51 and the computer name main
, and it has a share named code
which itself is a git repository, then both of the following commands should work equally:
git clone file:////main/code
git clone file:////192.168.10.51/code
If the Git repository is in a subdirectory, simply append the path:
git clone file:////main/code/project-repository
git clone file:////192.168.10.51/code/project-repository
How do I git clone from a Windows machine over ssh?
The easiest solution is to change the default Windows OpenSSH shell to bash. You can do this easily from powershell on the Windows machine:
powershell
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Program Files\Git\bin\bash.exe" -PropertyType String -Force
You may have to restart OpenSSH on the Windows machine and/or kill existing ssh connections from the client before it takes effect. Now you can clone without any extra -u option:
git clone ssh://windowsmachine/c/Users/unhammer/foo.git
(and if you previously specified uploadpack/receivepack, remove them from .git/config)
How to connect to a remote Git repository?
Now, if the repository is already existing on a remote machine, and you do not have anything locally, you do git clone instead.
The URL format is simple, it is PROTOCOL:/[user@]remoteMachineAddress/path/to/repository.git
For example, cloning a repository on a machine to which you have SSH access using the "dev" user, residing in /srv/repositories/awesomeproject.git and that machine has the ip 10.11.12.13 you do:
git clone ssh://dev@10.11.12.13/srv/repositories/awesomeproject.git
How to clone git repo from Windows to Linux?
Follow these steps:
Create a bare repository on remote.
I guess the answer provided by ad22 is good enough for you:
mkdir -p myrepo.git
cd myrepo.git
git init --bareOtherwise, you need to find out how to create a bare repository on server.
Copy or Memo the URL of that just created bare repository.
(Of cause, you need to have the right for accessing the URL.)
Add a new remote for your local repository.
Since you already have a local repository,
- Right click in that repository, Click
TortoiseGit
->Settings
, - Give the remote a shortname and URL you copied
- Add it and apply the setting.
See:
- Right click in that repository, Click
Push to remote by right clicking in local repository and click Push item.
In Push dialog,
- Select the remote you just added.
- Check the Push all branches checkbox if all branches can be public, otherwise you need push each branch one by one.
- Check the Include Tags checkbox if you want to push all tags.
Suppose that's all. ^__^
How to create a remote Git repository from a local one?
I think you make a bare repository on the remote side, git init --bare
, add the remote side as the push/pull tracker for your local repository (git remote add origin URL
), and then locally you just say git push origin master
. Now any other repository can pull
from the remote repository.
Related Topics
Can't Run Sonar Server Caused by Elasticsearch Cannot Running as Root
Prohibit Unaligned Memory Accesses on X86/X86_64
Why Is Pr_Debug of the Linux Kernel Not Giving Any Output
Who Can Access a File with Octal Permissions "000" on Linux/Unix
Understanding Sendfile() and Splice()
Xampp: Another Web Server Daemon Is Already Running
How to Strip Path While Archiving with Tar
Performance - Multithreaded or Multiprocess Applications
Clean Server Infected with C3284D Virus, Using Search and Replace
Why Linux Kernel Use Trap Gate to Handle Divide_Error Exception
Compiling 32 Bit Assembler on 64 Bit Ubuntu
How to Read Only First N Bytes from the Http Server Using Linux Command
Why Can't I Access Xampp's PHPmyadmin on Localhost? Access Is Forbidden
Ldd Says "Not Found" Even Though Library Is in My Ld_Library_Path
Tcp: Server Sends [Rst, Ack] Immediately After Receiving [Syn] from Client