286 questions
4
votes
1
answer
138
views
.gitattribute file not working as expected
I have the following .gitattributes file in my project
*.txt -diff
This works as expected, it ignores .txt files when I do a git diff. However when I change this to
*.txt diff=test
and add
[diff &...
2
votes
1
answer
67
views
Using mutliple line ending types in Git repository
I have a git repository used to build VM images with Packer. Some of the images built are based on Linux, some use Windows as an OS.
My repository contains scripts to be used in the Linux VMs and ...
0
votes
0
answers
61
views
Stop folder from being merged
I have a git repository where I have a "prod" branch and a "dev" branch. I have a just_dev_folder
in dev which I want to completely exclude from prod and I want to be able to merge ...
0
votes
1
answer
115
views
How to correctly filter file lines in git?
I'm using git to keep track of changes to my config files.
I additionally have a script called switch_theme.sh that switches between dark and light variant of themes. For our purposes, this script ...
0
votes
2
answers
180
views
Git LFS include all file extensions except for some
I'm trying to include all (data) files in LFS except if they have the .(r|R) or .(cpp|CPP) extension, but somehow both extensions end up in LFS too, and I'm unable the remove them from it. This is ...
1
vote
2
answers
633
views
Correct way to store .gitattributes (working-tree-encoding) after many commits?
There is a large Git repository (~4,000 commits) containing files in CP866 and does not contain a file named .gitattributes in the root of project. Is there any way to add .gitattributes (*.txt text ...
0
votes
0
answers
91
views
How to set git not to fiddle with newline on both windows and linux
I'm facing some issue when using a project tracked by git on both windows and linux. As suggested on other questions on windows I have
core.autocrlf=false
core.eol=<blank>
On Linux I have the ...
3
votes
0
answers
100
views
Is it possible to ensure git is case-sensitive on a repository level?
Context
A little context, to set up why I'm asking this question. .NET MAUI imposes a requirement on some files: "File names must be lowercase, start and end with a letter character, and contain ...
0
votes
1
answer
97
views
text attribute in .gitattributes and git config core.autocrlf
If the text attribute is unspecified, Git uses the core.autocrlf configuration variable to determine if the file should be converted.
From this statement, text attribute should override the core....
0
votes
2
answers
141
views
Target files with no file extension in .gitattributes
So, in .gitattributes,* matches all files, including those that have no file extension, and more specific rules can be applied later down in the attributes file.
How should one go about targeting ...
1
vote
2
answers
273
views
How can I keep files unchanged using .gitattributes between branches?
I have a struggle with git about a case. I want to keep track of my project on a GitHub repository with two branches main and dev. However, there are two files, and I don't want to change them when ...
0
votes
1
answer
891
views
git add --renormalize does not re-checkout my files with the correct line endings
I have a repository which I use between Windows and Linux.
Currently some files, for example the file myfolder/myfile.txt is stored with CRLF (DOS) line endings and checked out with CRLF linedendigs.
...
1
vote
1
answer
303
views
Is there a way to override a gitattributes filter when adding new files or file changes to index?
The context:
My team has a repo with lots of jupyter notebooks in it. We often work with sensitive data in jupyter notebooks, and we want to make sure that we don't accidentally commit any data ...
1
vote
1
answer
111
views
Exclude a file from merging to the main branch
The environment:
We use Bitbucket Cloud for repository management (and merges) and Jenkins for CI/CD. Branches with open pull requests are built and deployed to a temporary environment (which ...
0
votes
1
answer
45
views
How to configure .gitattributes s.t. files are not shown as dirty when comitting with LF on windows?
I want to configure the .gitattributes in a repository to resolve EOL issues for all users without them needing to change their local git configuration.
My .gitattributes looks like this:
* text=auto
...