Created
November 7, 2016 03:11
-
-
Save lovebdsobuj/bfd4405049ebea9fd009359d83fc6380 to your computer and use it in GitHub Desktop.
git archive - export git as zip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
git init # on the root of the project folder | |
git add . | |
git commit -m "git archive" | |
FOLDERNAME="Backup" | |
FILENAME="archive_$(date +%d)_$(date +%m)_$(date +%Y)_$(date +%I)$(date +%M)$(date +%S)" | |
mkdir -p "$FOLDERNAME" | |
git archive HEAD --format=zip > Backup/$FILENAME.zip | |
echo Press Enter to Close this Window... | |
read |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create
.gitignore
on the root of the project folder.And add this