0

Note: I am relatively new to Git / GitHub. I understand my way around, but I am confused with this corner case

Background

I created an IntelliJ color scheme git repo and pushed it to github online. The directory structure was ad hoc and made up of only output. This was actually fine and worked well.

I noticed that people would not get updates from me this way, and decided to create a JetBrain Repo plugin. This also works well; however, my github location and plugin location on my PC are different.

Issue

I looked over Change Git repository directory location. but was not sure if this fit my usecase.

Since my github is just output files and my plugin files are all input files, can I simply just copy over my .git files (along with README files and such) , and expect it to work correctly?

The linked SO question seems to relate to JUST moving the same directory structure and files over to another location. I am dealing with different directory structure, different files, and directory location; however, it IS the same project.

Update

Before, my workflow was:

  1. Modify Color Scheme in IDE
  2. Export settings from IntelliJ
  3. Place in \Documents\GitHub\ChroMATERIAL
  4. Windows GitHub Client: \Documents\GitHub\ChroMATERIAL merge
  5. GitHub

Now it is

  1. Modify Color Scheme in IDE
  2. Run project and autogenerate output in \IdeaProjects\ChroMATERIAL
  3. Place output in \Documents\GitHub\ChroMATERIAL
  4. Windows GitHub Client: \Documents\GitHub\ChroMATERIAL merge
  5. GitHub

What I want

  1. Modify Color Scheme in IDE
  2. Run project in \IdeaProjects\ChroMATERIAL
  3. Windows GitHub Client: \IdeaProjects\ChroMATERIAL merge
  4. GitHub
Community
  • 1
  • 1
Christopher Rucinski
  • 4,533
  • 2
  • 23
  • 54

1 Answers1

2

I'm assuming that the generated output matches the structure you need for your Github repository. If so you could easily move your .git folder from \Documents\Github\ChroMATERIAL to \IdeaProjects\ChroMATERIAL

What you should check:

Will the generated output directory be cleared if you clean the project into Intellij? If so you should stick to your current workflow since you could easily delete your local copy.

The other thing which could be a problem is the Github Desktop Client since I don't know how it behaves nor how or if it must be configured in a special way to reflect your changes. (if you just call it from the inside of the repository it should not be a problem at all)

For your explanation: Git uses relative paths. So it is irrelevant where the repository lives inside your system. The important part is the structure inside the repository since this will be cloned to the remote repository.

I recommend that you copy your .git folder rather than move it. If something goes wrong you can easily revert.

chris115379
  • 192
  • 2
  • 11
  • Before you should also check if a project clean from Intellij does not delete the contents of the directory. Besides of this it should work. – chris115379 Oct 31 '15 at 22:38
  • Well, you answer was helpful. I did somethings different when I noticed it was possible. I did NOT copy `.git` over to the directory because I wanted that directory to stay the same; however, I decided to create a new IntelliJ IDEA project in the directory I wanted it and moved the needed files over. This allowed me to just update the files like normally. So it was just like I removed the old files and added the new files. – Christopher Rucinski Nov 01 '15 at 18:27