git-add Questions

3

Solved

I used the solution here to change tab size in git diff output. That works fine with git diff. I have these settings in my .gitconfig: [core] whitespace = tabsize=4,indent-with-non-tab pager = ...
Tartan asked 3/8, 2013 at 16:26

12

Solved

What is the difference between git add [--all | -A] and git add .?
Sporogenesis asked 21/2, 2009 at 6:51

3

Solved

I have a file that I've renamed and then edited. I would like to tell Git to stage the rename, but not the content modifications. That is, I wish to stage the deletion of the old file name, and the...
Calumniate asked 17/4, 2015 at 17:44

4

Solved

We have modified files in path/to/another/ and path/to/main/. Files in path/to/main/ already added into git cache but we have updated path/to/main/Bar.php file AGAIN. We now have the following situ...
Traylor asked 13/9, 2016 at 19:7

37

Solved

How do I add an empty directory (that contains no files) to a Git repository?
Scarabaeoid asked 22/9, 2008 at 16:41

13

Solved

I'm trying to use git add --interactive to selectively add some changes to my index, but I continually receive the "Your edited hunk does not apply. Edit again..." message. I get this message even ...
Hackler asked 16/7, 2010 at 20:23

6

Solved

When I run git add -p, is there a way for git to select newly made files as hunks to select?? So if I make a new file called foo.java, then run git add -p, git will not let me choose that file's c...
Information asked 24/1, 2013 at 0:9

10

Solved

Say I have a file in my git repository called foo. Suppose it has been deleted with rm (not git rm). Then git status will show: Changes not staged for commit: deleted: foo How do I stage this in...
School asked 11/9, 2012 at 16:1

1

Solved

When there's a conflict, git status shows this: Unmerged paths: (use "git restore --staged <file>..." to unstage) (use "git add <file>..." to mark resolution) bot...
Orosco asked 30/1, 2021 at 10:12

3

Solved

Sometimes I run git add . and big files that weren't supposed to get added are added. How can I see which files were added without commiting? And how to 'un-add' those files or all files at once so...
Anarchy asked 27/10, 2020 at 6:48

2

Solved

I want to go back and remove several portions of a commit that is two commits back. I hoped I could do git rebase -i HEAD^^, edit the commit, and then use git add --patch <file> on the file. ...
Raillery asked 25/10, 2015 at 18:3

2

Solved

Is there any difference between: git add . and git add --all ?
Expediency asked 11/4, 2014 at 3:47

3

Solved

I have a file that I've been working on and then realized that I had a mistake in it a few lines above where I've been working. I quickly fixed the mistake and want to commit it before I commit the...
Morganstein asked 13/7, 2009 at 21:34

1

Solved

I often use git add -p somefile to interactively stage only parts of the in the given file. However, if the file has more complicated changes, the default diff goes awry and so do the hunks offered...
Rebel asked 10/12, 2019 at 15:6

3

All the (hundreds of) files in my repo now show up as untracked and deleted though I can't figure out what's going on? ls shows the files are in the directory but git status . in the directory ...
Vie asked 10/3, 2016 at 6:18

11

Solved

One of the commands I find incredibly useful in Git is git add -u to throw everything but untracked files into the index. Is there an inverse of that? Such as a way to add only the untracked files ...
Pfeiffer asked 16/9, 2011 at 15:1

11

Solved

One of the commands I find incredibly useful in Git is git add -u to throw everything but untracked files into the index. Is there an inverse of that? Such as a way to add only the untracked files ...
Celestecelestia asked 16/9, 2011 at 15:1

1

Solved

In Git, while adding files to a commit, we can add all files matching a pattern like so: git add **Component** I find this feature pretty useful to quickly add lots of files with similar names. ...
Stillness asked 3/5, 2019 at 21:14

2

Here are the git commands which I have typed $ git add -u -n add 'proj1/Foo.scala' $ git add . $ git add . $ git commit -m "message" On branch feature/branch Your branch is up-to-date with '...
Twinkle asked 29/3, 2016 at 17:33

0

I have a feeling my git cache is getting confused fairly often. I work on Mac and use both git at terminal and SourceTree. I add or modify few files but I often notice that even files I have neve...
Madonna asked 2/1, 2019 at 6:11

1

I started working on a Xamarin crossplatform development recently. While some of devs in my team are using Mac for development (with Visual Studio for Mac), others are using Windows (with Visual St...
Slam asked 13/11, 2018 at 23:28

6

Solved

Using git add command becomes tedious once the file path becomes lengthy. For e.g. git add src_test/com/abc/product/server/datasource/manager/aats/DSManger.java Is it possible to bypass specifying ...
Escalator asked 6/6, 2011 at 7:26

3

Solved

What's the difference between: git add . git commit -a Should I be doing both, or is that redundant?
Theine asked 22/8, 2010 at 13:34

2

Not too long ago, I asked this question. I received an answer, but it did not solve the issue I was having, so I was advised to create a new question with more detail. Just to reiterate, I am gett...
Judicial asked 1/2, 2017 at 4:57

2

Solved

Trying to split a hunk into smaller ones by git add -p and split option, but entire file appears as one hunk and I can't split it. I can edit, but removing lines causes the patch to fail. git h...
Geary asked 25/6, 2016 at 15:12

© 2022 - 2024 — McMap. All rights reserved.