![]() If you need to unmount your mounted Windows shared directory, do: sudo umount -a -t cifs -l Sources. Voila! Bonus Step: Unmount mounted Windows shared directory. Then issue the command to perform the clone. In this example, I am assuming it’s your home directory. Go to the place where you need to create your working copy of the Git repository. If that works, you can go clone your Git repository, if not, you’ll have to troubleshoot. If you are only using the default settings, when you try to install git you will get version 1.7.1. Change into the directory that we want to have the repository cloned into, and then use this command. This is the address we must pass to the git command when we clone the repository. ![]() Step 4: Verify the Windows shared directory is successfully mounted.Īnd check whether you can see files from your Windows shared directory. As JERC said, make sure you have an updated version of git. On the main page of the boxes repository, theres a green button labeled 'Clone or download.' Click the button to see the web address. We use the options username and password here. “Options are specified with a -o flag followed by a comma separated string of options.”. So CIFS is the file system types used here. “The argument following the -t is used to indicate the file system type.”. Here are what various flags to mount application in above command mean (Extracted from man pages.): -t, -types ![]() sudo mount -t cifs -o username= WindowsUsername,password= WindowsPassword // IPAddressToWindowsMachine/ SharedDirectoryFromWindows /mnt/ directory_from_windows We need to be able to access the directory from Windows through our mount point. sudo mkdir /mnt/ directory_from_windows Step 3: Mount the directory from Windows onto the created mount point. We need a place in our file system to mount the Windows directory. Sudo apt-get install system-config-samba Step 2: Create a mount point. We need Samba to connect to Windows shared directories. This is how I did it: Step 1: Install the required software. Then I decided to access the directory in Windows with Samba and mount it on local file system, and then clone, pull, and push from and to it considering it as a local location. I guess that’s because I am not much experienced with that protocol. First I tried to do it with SSH, but I wasn’t successful. If you also wanted root to inherit your settings in your ~/.ssh/config, you could not do that with ssh environment variables, but you could do that with git environment variables.Working on a project at Sanmark Solutions, I encountered a situation where I needed to clone a Git repository placed in a shared directory in a Windows machine into a working directory in a Linux machine. Now, that only addresses key authentication. Even for other target users than root, passing that variable across would not make sense as the target user couldn't make use of that authentication agent. ![]() For instance sudo sshd to start a sshd service would mean all ssh sessions started through that service would inherit your $SSH_AUTH_SOCK, polluting users environment with something they can't and shouldn't use. In general, you don't want to pollute root's environment, as that's the user you start services as. I would not got with suggestion in comment to add $SSH_AUTH_SOCK to the env_keep list. To pass every environment variable across sudo, not just $SSH_AUTH_SOCK. (and add keys to it as needed with ssh-add).Īlternatively, you can use sudo -E git clone. ![]() Copy and paste the resulting key and paste it into Github account, by going to Settings, then SSH and GPG section and click the New SSH key button. From within your Ubuntu server run cat /.ssh/idrsa.pub. If you don't have a ssh agent running, you can start one beforehand with: eval "$(ssh-agent)" From within your Ubuntu server run ssh-keygen -t rsa. That basically tells the git command started by root (or the ssh command started by that git command) to use your ssh agent (how to connect to it, which root should be able to as it has every right). If you have a ssh agent running, do: sudo SSH_AUTH_SOCK="$SSH_AUTH_SOCK" git clone. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |