If the program won't work without the files it seems like splitting them into a separate repo is a bad idea. We have large test suites that we break into a separate repo but those are truly "auxiliary" files.
However, you may be able to manage the files in a separate repo and then use to pull them into your project in a sane way. So, you'd still have the full history of all your source but, as I understand it, you'd only have the one relevant revision of your images submodule. The git-submodule facility should help you keep the correct version of the code in line with the correct version of the images.git-submodule
Here's a good introduction to submodules from Git Book.
Yes, using attributes. Put something like this in your file (create it if it doesn't exist):.gitattributes
*.sln binary
*.suo binary
*.vcxproj binary
Here is actually a predefined macro, equivalent to binary.-diff -merge -text
If you want to still be able to see the diff, you can use:
*.sln -merge -text
This way, the files won't be merged, not have eol normalized, but meanwhile diff-able.*.sln
If you want to force git to show binary files diff as a plain text diff use option like so:--text
git diff --text
diff <(git grep -Ic '') <(git grep -c '') | grep '^>' | cut -d : -f 1 | cut -d ' ' -f 2-
Breaking it down:
git grep -c '' prints the names and line counts of each file in the repository. Adding the -I option makes the command ignore binary files.diff <(cmd1) <(cmd2) uses process substitution to provide diff with named pipes through which the output of cmd1 and cmd2 are sent.grep and cut commands are used to extract the filenames from the output of diff.Out of the box, git can easily add binary files to its index, and also store them in an efficient way unless you do frequent updates on large uncompressable files.
The problems begin when git needs to generate diffs and merges: git cannot generate meaningful diffs, or merge binary files in any way that could make sense. So all merges, rebases or cherrypicks involving a change to a binary file will involve you making a manual conflict resolution on that binary file.
You need to decide whether the binary file changes are rare enough that you can live with the extra manual work they cause in the normal git workflow involving merges, rebases, cherrypicks.
will prevent untracked files from being added (without an .gitignore) to the set of files tracked by Git. However, Git will continue to track any files that are already being tracked.add -f
To stop tracking a file, we must remove it from the index:
git rm --cached <file>
To remove a folder and all files in the folder recursively:
git rm -r --cached <folder>
The removal of the file from the head revision will happen on the next commit.
WARNING: While this will not remove the physical file from your local machine, it will remove the files from other developers' machines on their next .git pull
tldr;
git log --all --numstat \
| grep '^-' \
| cut -f3 \
| gsed -r 's|(.*)\{(.*) => (.*)\}(.*)|\1\2\4\n\1\3\4|g' \
| sort -u
Explanation:
The option git-log--numstat
shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly. For binary files, outputs two - instead of saying 0 0.
Source: https://git-scm.com/docs/git-log, emphasis mine
This produces output entries like the following:
commit 0123456789012345678901234567890123456789
Author: Joe Example <jexample@domain.com>
Date: Thu Mar 9 15:33:29 2017 +0000
edit Dockerfile, add assets/foobar.jpg
1 1 Dockerfile
- - assets/foobar.jpg
The matches lines with a leading hyphen, the grep '^-' prints the third tab-delimited field, and thecut -f3
sed -r 's|(.*)\{(.*) => (.*)\}(.*)|\1\2\4\n\1\3\4|g'
detects files that have been moved/renamed and prints both the source and destination; e.g., it would change this:
path/to/{foo => bar}/my-document.pdf
to this:
path/to/foo/my-document.pdf
path/to/bar/my-document.pdf
Finally, the will accumulate, sort, and uniquify the list of paths.sort -u
EDIT: You need gnu-sed installed because the default does not have the -r option. Best to install via Brew: sedbrew install gnu-sed
I think git-annex does exactly what you need: http://git-annex.branchable.com/