DEV Community

Discussion on: Git Commands Cheatsheet: Advanced (20+ Git Commands Advanced )

Collapse
 
jnareb profile image
Jakub Narębski • Edited

About the last command: which tar and which version it requires for it to have --exclude-vcs, and why not simply use the git archive command?

Collapse
 
aashiya123 profile image
aashiya123

for using -exclude-vcs, tar 1.34: 6.4.
also, if you want to tar a folder without having the .git files then we use the "--exclude-vcs" instead of git archive. archive will help in archiving the git tracked files. If you want the archive to include the files tracked by git, but not the git repository itself or any generated or otherwise untracked file, then use git archive.

Hope it helps

Collapse
 
jnareb profile image
Jakub Narębski

Ah, so the choice between using tar and using git-archive is whether we want to include untracked files, like generated files, in the archive.

Thread Thread
 
aashiya123 profile image
aashiya123

right..