This file contains hidden or 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/bash | |
## Note: All machines should be up to date before any of them run this script, | |
## and at least one machine should have all the remote branches checked out. | |
## Use this script to remove .gitignored files from a git repository's index, | |
## but to not remove the files locally. It should be run on all machines that | |
## need to preserve the .gitignored files, since a "git pull" or "git checkout | |
## <branch>" would remove them otherwise (original idea from | |
## http://www.arlocarreon.com/blog/git/untrack-files-in-git-repos-without-deleting-them/). |
This file contains hidden or 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
# Since Git does not have a way to copy files, this implements the workaround from here: | |
# https://stackoverflow.com/a/46484848/2016290 | |
import argparse | |
import os | |
import subprocess | |
TMP_BRANCH = 'tmpToCopyFile' | |
def gitCopyFile(origPath, newPath): |