push branch tarball to github with git
I have a git branch with let us say 2 directories, with some code files in it:
and I’ve made a tarball of this 2 directories in the same branch with Git. But to create a tarball with Git you need to do “git add htmlcode jscode”
- How do I get the effect of GNU tar's --strip-components with git-archive?
- Capistrano 3 at deployment on Ubuntu 12.04 LTS gives error
- zip or tar the resulting files with command “git status” over modified files. Linux
- How to have git treat tar archives transparently as directories?
- How to extract tar (ed) Android repo?
- Create and upload tar.gz to S3 bucket
The problem I now have is that it pushes all the files in my branch (i.e. htmlcode, jscode and the tarball) to Github. I know why this happens, but don’t know how to make a work arround to push only the tarball to Github.
Can anybody help me?
One Solution collect form web for “push branch tarball to github with git”
No part of this makes sense. Why are you using Git to generate the tarball, if you don’t want to include the original files in Git?
Just use the tar/gzip commands themselves:
tar czf my-code.tar.gz htmlcode jscode
And then (if you really do want to do this) add the resulting file to Git:
git add my-code.tar.gz git commit -m "Version-controlling a tarball for some unknown reason" git push
That said, there’s no reason to just be version-controlling the tarball. You really, really want to include the original source files in Git, and exclude the tarball. By only including the tarball, you’re actually just hindering Git’s built-in compression and rendering your repo more or less useless.