Does Git Add a Verbose Switch

I am going to move all my personal public repo to github. One of the decisions I made was to use the console, as that means a smaller tool if I ever need to change my PC, etc.

I would be a huge user of console applications and would be new to git. I decided to purchase the Tekpub Mastering git series, as it shows you how to translate git bash as a toolbar.

Everything works fine except for the add all command:

git add . 

It seems to work, but I see no signs of it working or not. Is there a detailed switch (I think this is what it will call) that will say which files were tracked after running the command?

I am using Visual Studio 2010 with a standard git installation (no git extensions)

+74
git github git-bash
Sep 06 '11 at 11:44
source share
4 answers

For some git commands, you can specify --verbose ,

git 'command' --verbose

or

git 'command' -v .

Make sure the switch is after the actual git command. Otherwise - it will not work!

Also useful:

 git 'command' --dry-run 
+104
Sep 06 2018-11-11T00:
source share

Well, like (almost) any console program for unix-like systems, git tells you nothing if the command completed successfully. It prints something only if something is wrong.

However, if you want to be sure of what just happened, just type

 git status 

and see which changes will be made and which will not. I suggest you use this before every commit, just to make sure you haven't forgotten anything.

Since you seem to be new to git, here is a link to a free online book that introduces you to git. This is very useful, it writes about the basics, as well as various well-known workflows: http://git-scm.com/book

+6
Sep 06 2018-11-11T00:
source share

You can use git add -i to get an interactive version of git add , although this is not quite what you need. The easiest way to do this, after git add ed, is to use git status to see what works or not.

Using git add . not really recommended unless this is the first commit. Usually it is better to explicitly specify the files that you want to put so that you do not accidentally run unwanted files (temporary files, etc.).

+4
06 Sep 2018-11-11T00:
source share

I debugged the problem using git and I needed a very detailed output to figure out what was going wrong. As a result, I set the GIT_TRACE environment GIT_TRACE :

 export GIT_TRACE=1 git add *.txt 

Exit:

 14:06:05.508517 git.c:415 trace: built-in: git add test.txt test2.txt 14:06:05.544890 git.c:415 trace: built-in: git config --get oh-my-zsh.hide-dirty 
0
Apr 09 '19 at 19:08
source share



All Articles