

- #Git add remote and init how to
- #Git add remote and init install
- #Git add remote and init update
- #Git add remote and init windows 10
- #Git add remote and init windows
Checking git log on remote repository again MINGW64 / This time we used the repository reference name 'origin' instead of the whole url (check out last tutorial's 'Tracking of repository' section). Origin ssh://192.168.0.13/home/joe/my-project.git MINGW64 /d/git-example/other-client/my-project (master) $ git add -A & git commit -m "new changes"Ĭreate mode 100644 MINGW64 /d/git-example/other-client/my-project (master) $ echo some-content > MINGW64 /d/git-example/other-client/my-project (master) Let's add a new file to our new client project and push that to the central repository: MINGW64 /d/git-example/other-client/my-project (master) Receiving objects: 100% (3/3), MINGW64 /d/git-example/other-client/my-project (master) Remote: Total 3 (delta 0), reused 0 (delta 0)

$ cd MINGW64 /d/git-example/other-client/my-project $ mkdir MINGW64 /d/git-example/other-client On the client machine, let's create a new directory representing another client (other than the original one /d/git-example/my-project) and clone the remote project via ssh: MINGW64 /d/git-example

#Git add remote and init windows
Instead of going to the server machine again, we can access it via Putty, or even git bash for windows comes with a ssh client, let's use that: MINGW64 / 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)
#Git add remote and init windows 10
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
#Git add remote and init install
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.
#Git add remote and init update
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.
#Git add remote and init how to
In the last tutorial we saw how to host a central repository through local protocol (i.e.
