347 questions
0 votes
1 answer
88 views
Error: "patch does not apply" when manually editing diff
I have the following git diff for Python code: @@ -520,7 +520,7 @@ class AreaManager: self.broadcast_ooc( f"[{client.id}] {client.showname} ({client.name}) is GM in this hub ...
3 votes
4 answers
127 views
Is there a way to `git commit --patch --only`?
Say I’ve been staging changes using git add, but then realize that there is some small change—consisting of a single hunk, let’s say—I should commit separately before committing the staged changes. ...
0 votes
0 answers
80 views
Is it possible to force `git add -p` to use a different diff algorithm without changing the repository config? [duplicate]
If I do the following: git config diff.algorithm patience git add -p then git add -p forms its diffs using the patience algorithm. Is there any way to force git add -p to use patience as a one-off ...
0 votes
1 answer
69 views
Git alias to add files and then show status is showing from parent directory
I work in C# with Unity, and it often touches a lot of files that don't want to commit. My changes that I want to commit are almost always exclusively .cs files. I created a git alias to stage all of ...
0 votes
0 answers
42 views
Reset all uncommited changes when working in a local Git repository
I need to reset all uncommitted Git changes while working in a local Git repository. I'm using this answer to the 12 year old Unstaged changes left after git reset --hard question in a Python script ...
1 vote
0 answers
127 views
Why is "git add -A" so much slower than "git status"? And could I speed up my "git add"s by working from "git status" instead?
In git, I usually prefer to not use the staging area very much, and just work with my working tree. Call me crazy, but I don't get much use out of this extra step before committing, etc., of adding ...
0 votes
0 answers
50 views
Git (v 2.20) is no adding text files others do [duplicate]
I am using git version git version 2.20.0.windows.1 I have problem with adding *.txt files. I have created a project. There was only PCB files. At the beginning. I have commited it. Then I have ...
-2 votes
2 answers
3k views
Changes not staged for commit - What are the 3-states in Git? How to use them?
I am working on the main branch updating some files but not the ones on the list below, however whenever I run git status I get the message below with the files highlighted in red which suggests there ...
3 votes
2 answers
78 views
Git+Bash / GitBash: Add files matching both first-letter-uppercase or all-lowercase filenames of certain pattern along with respective plurals
I have some Laravel/Livewire files matching filename patterns like seen in below: app/Livewire/String1Table.php app/Livewire/String1s.php app/Livewire/EditString1.php app/Models/String2Table.php app/...
1 vote
0 answers
63 views
Configure `git add -p` to split hunks automatically
During git add interactive, is it possible to automatically split the hunk (where applicable)?
-1 votes
2 answers
3k views
How do i fix this fatal:bad boolean config value
$ git push fatal: bad boolean config value 'origin' for 'push.autosetupremote' I want to push in git but an error appears as above im using new version git I hope to be able to git push some of my ...
-1 votes
1 answer
101 views
How do I solve this problem in github please [duplicate]
I'm getting this warning anytime I try to git add . all my file in my folder: warning: in the working copy of 'calculator-app-main/.gitignore', LF will be replaced by CRLF the next time Git touches it ...
0 votes
1 answer
308 views
How to stage the files to the local git repository where file names has space in them? [duplicate]
I have 2 files locally: File 1.txt and File 2.txt. When I stage the files with the command git add File 2.txt, it is giving me the below error: fatal: pathspec 'File' did not match any files
0 votes
1 answer
429 views
git add fails with fatal: src/mytest.pax added file untagged, set correct file tag
When I try to add files to a commit group I get an error. Command: git add . Error: fatal: src/python/files/mytest.pax added file untagged, set correct file tag git —version: git version 2.3....
3 votes
0 answers
85 views
Customize "Stage this hunk" prompt in `git add -p`?
I've started reusing git add -p as a building block for other situations where it's nice to have an interactive interface to accept/reject/edit changes. It's profoundly useful! The biggest win for me ...