0

If I want to zip a directory up from my git repository will it contain git messages?

How would I export a directory without any version control?

If possible if it's a feature from Github.

I have found and linked to this post but it is not clear if it's the same thing as I'm asking and it's from 2008:
Do a "git export" (like "svn export")?

Can I simply copy the directories locally? It's the root directory that has a hidden version control folder correct?

I found git-archive that makes a zip: https://alvinalexander.com/git/git-export-project-archive-cvs-svn-export

1.21 gigawatts
  • 16,517
  • 32
  • 123
  • 231
  • 3
    Use `git-archive` – William Pursell Jul 15 '19 at 21:44
  • I just found a good post on `git-archive`. I can export to a zip and then unzip and copy the directories I need. – 1.21 gigawatts Jul 15 '19 at 21:45
  • 1
    Possible duplicate of [Do a "git export" (like "svn export")?](https://stackoverflow.com/questions/160608/do-a-git-export-like-svn-export) – EmilioPelaez Jul 15 '19 at 21:47
  • @EmilioPelaez I linked to that in my post. Please remove the duplicate. – 1.21 gigawatts Jul 15 '19 at 21:49
  • @1.21gigawatts you found an answer to your question and instead of trying that out you made a duplicate question. I don't see a need for both questions so I'm leaving my close vote up. – EmilioPelaez Jul 15 '19 at 22:47
  • @EmilioPelaez What are you talking about? I linked to it, I said it didn't quite answer my question and explained that. My question is different in that I want a specific directory and that I don't know about svn export and how it compares. – 1.21 gigawatts Jul 15 '19 at 23:39

1 Answers1

1

If I want to zip a directory up from my git repository will it contain git messages?

If your zip file contains the .git folder, yes it will. If the .git folder is not present, then the commit messages will not be contained. However, unless you also remove .gitignore, .gitattributes and .gitmodules files, someone will be able to tell that it was once tracked through git.

How would I export a directory without any version control?

Just use git archive 1, as also linked in the duplicate question 2. If you just want a subdirectory, you may zip that directly.

If possible if it's a feature from Github.

Here is how you can create releases on GitHub: https://help.github.com/en/articles/creating-releases After doing this, you can automatically download the repository as a Zip or Tar file. Exactly what you want!

I have found and linked to this post but it is not clear if it's the same thing as I'm asking and it's from 2008: Do a "git export" (like "svn export")?

Yes, your question is mostly a duplicate.

Can I simply copy the directories locally? It's the root directory that has a hidden version control folder correct? Yes, this is correct. All the version data is stored inside the root's .git folder.

I found git-archive that makes a zip: https://alvinalexander.com/git/git-export-project-archive-cvs-svn-export

Just use the builtin git archive tool for that.

Unapiedra
  • 15,037
  • 12
  • 64
  • 93