![]() ![]() ![]() Over internet the ssh url would look like this: Viewing remote repository git logs To ssh://192.168.0.13/home/joe/my-project.gitĪs seen above we used complete path 192.168.0.13/home/joe/my-project.git prefixed with ssh:// Let's use push command: MINGW64 /d/git-example/my-project (master) Pushing project from client to remote repository via SSH $ git add MINGW64 /d/git-example/my-project (master) $ echo test-content > MINGW64 /d/git-example/my-project (master) Initialized empty Git repository in MINGW64 /d/git-example/my-project (master) Now lets login to a windows 10 client machine and create our example project via git bash for windows. Let's use ifconfig command for that: joe mint-smtx :~$ ifconfig We also need to know the Linux server's IP address on the local network so that the clients can access it via SSH. rw-rw-r- 1 joe joe 73 Feb 26 02:02 description ĭrwxrwxr-x 2 joe joe 4096 Feb 26 02:02 branches Initialized empty Git repository in /home/joe/my-project.git/ĭrwxr-xr-x 15 joe joe 4096 Feb 26 02:01. Joe mint-smtx :~/my-project.git$ git init -bare Let's create a folder 'my-project.git' under user home directory and initialize it as git bare repository: joe mint-smtx :~$ clear Let's install git: joe mint-smtx :~$ sudo apt install gitĬhecking again: joe mint-smtx :~$ git -versionĬreating Git Remote Repository on the server Installing GitĬhecking if Git is already installed: joe mint-smtx :~$ git -versionĬommand 'git' not found, but can be installed with: ![]() Now we can access the server machine via ssh. Let's check that: joe mint-smtx :~$ ps -A | grep sshd Now install the OpenSSh server: joe mint-smtx :~$ apt-get install openssh-serverĪfter above command has finished, the sshd must be running. If there's no output then we need to install OpenSSH.įirst update the package lists: joe mint-smtx :~$ sudo apt-get update To check whether SSH server is installed and running, use following command: joe mint-smtx :~$ ps -A | grep sshd To host a Git repository via SSH, we need to run a SSH server on the Linux machine and of course we also need to install Git there. We will also clone the repository and pull/push the repository to/from Windows 10 machine (which will be acting as a client). We are going to setup remote repository on a Linux Mint machine, which will be running on the local network. In this tutorial we will do the same thing but over SSH protocol. You can download a tarball and build from source, or use a 3rd-party repository such as the IUS Community Project to obtain a more recent version of git.In the last tutorial we saw how to host a central repository through local protocol (i.e. RHEL and derivatives typically ship older versions of git. Gentoo # emerge -ask -verbose dev-vcs/git Arch Linux # pacman -S git openSUSE # zypper install git Mageia # urpmi git Nix/NixOS # nix-env -i git FreeBSD # pkg install git Solaris 9/10/11 ( OpenCSW) # pkgutil -i git Solaris 11 Express # pkg install developer/versioning/git OpenBSD # pkg_add git Alpine $ apk add git Red Hat Enterprise Linux, Oracle Linux, CentOS, Scientific Linux, et al. If you prefer to build fromįor the latest stable version for your release of Debian/Ubuntu # apt-get install gitįor Ubuntu, this PPA provides the latest stable upstream Git version # add-apt-repository ppa:git-core/ppa # apt update apt install git Fedora # yum install git (up to Fedora 21) It is easiest to install Git on Linux using the preferred package ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |