1

I'm a total beginner in GIT.

I have one machine (S) with Ubuntu installed. I cloned remote repository (R) into that machine, everything went fine. Machine (S) will be a server hosting my application. I also need to commit changes to (R). To this moment everything works ok.

My workstation will be machine (W) with Windows and PHPStorm installed. So I thought it would be a good idea to clone repo from (S) to (W), work with the code on (W) and then commit changes back to (S), and then commit major changes to (R).

My problem is than I don't know how to clone (S) repo to (W). Everytime I get "Repository URL is malformed URL or non existent".

My project web address is 192.168.1.100/project. What should I do to clone (S) repo to (W)?

Thanks in advance

mbr
  • 11
  • 2

2 Answers2

0

You should clone your repository (R) directly on your (W), continue developing your application and then commit and push directly back to (R). Then you can pull the newest changes on (S) directly from (R) when needed. This way you avoid inconsistencies.

If you are worried about work in progress states in your main repository, you should take a look at git branches.

You can for example create a dev branch for active development which can in fact contain states of your application that are not finished or even able to run. When you are finished developing that feature, you can merge that branch back into your master branch which should only contain working and finished states.

Florian Lüdiger
  • 168
  • 3
  • 12
0

You can do so via ssh. I tried this from linux, creating on machine (S) a test repository. then on machine (W) i cloned it with

git clone username@<hostname/ipaddress>:path/to/repo/dir

Please note that for (W) the origin remote (let say the machine it consider as server), will be (S), not (R). So every time you do a push it will try to send everything to (S). If you want to change that you need to change the remote with git remote set-url

ErniBrown
  • 1,283
  • 12
  • 25