Last active
November 6, 2020 18:18
-
-
Save vikjam/cec2e1237a3e38b006dcafb7b4f0976d to your computer and use it in GitHub Desktop.
Ignore .env and specific folders in Git
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
# Ignore everything in this directory (place in the directory you want to ignore) | |
* | |
# Except this file | |
!.gitignore |
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
# https://bcodes.io/blog/post/git-commit-config-files-but-ignore-future-changes | |
touch .env | |
git add .env | |
git commit -m "Add empty .env" | |
git push origin master | |
git update-index --skip-worktree .env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment