-3

So I have just started learning git. As such, I was using two different computers to understand the collaboration mechanism. As such, in my original computer I was writing and HTML file. Which had a local hyperlink reference:

<link rel="stylesheet" href="F:\Codes\HTML\Experiment\Styling\Experimental.css">

But now that I have cloned that repository in the other pc (It did not have any of these files before in it), these relative directory paths are changing. The same "Experimental.css" in the second pc has been stored in a different path, obviously. In fact, the second pc doesn't even have a local drive with the letter F. For the second pc, the path will be:

<link rel="stylesheet" href="D:\ZCode Files\HTML\Web_Ex\Styling\Experimental.css">

As such, how am I supposed to work between two different computers without having to change such lines of codes every time? Am I missing some obvious feature here or is it possible to set git to ignore certain portions of code?

1 Answers1

0

You normally would want to use relative paths as Sergio said. Create a big project with all the files inside one folder, then change your paths to denote the root "./" folder of your project.

For example, split it into "Images", "Scripts", etc.

It isn't related to GIT, because you're using GIT for syncing your projects across your devices, but you're referring to an issue in your HTML document.

E_net4
  • 27,810
  • 13
  • 101
  • 139
  • thanks a lot for clarifying. I was so fixated on assuming that this was supposed to be solved with some git functionalities that I completely forgot about editing the path itself. – Redeemer X Dec 29 '21 at 11:39