yevgeller (4) [Avatar] Offline
#1
Listing 1.3 lists the files created in a new repository. Then, a couple of paragraphs below, there is a statement: "You shouldn't edit any of these files directly until you have a more advanced understanding of Git (or, in my experience, never at all)". I suggest the author removes the part in parentheses. Here is why:

The "exclude" file is a powerful feature that is easy to use. The file itself contains all the explanation on using it. I put the following lines in the file when I start a .Net project, because I only care about source code, the rest can get recompiled

bin/
obj/
PerfLogs/
*sap
*bak

Perhaps the author could state the purpose of the exclude file, explain the syntax (there is an example in the file), and list a couple of use cases.

Just my two cents, I enjoyed the chapters that I have read so far and I can't wait to read future chapters when they come out.
Mike McQuaid (83) [Avatar] Offline
#2
Re: 1.3.4 Discussion, editing some internal git files
Thanks for the kind words.

In the case of the exclude file I'd always recommend using a per-repository or global .gitignore file instead. I'm sure the exclude file works well for you, though.

Problem is with Git there's always multiple ways of doing things and I typically only want to teach one way.
yevgeller (4) [Avatar] Offline
#3
Re: 1.3.4 Discussion, editing some internal git files
Sir,

Thank you for your reply. I withdraw my objection smilie

I did not know about .gitignore files, I must have missed it when I read the Git Book or was not paying attention. Now what you said in the book makes sense to me, thank you for enlightening me!
Mike McQuaid (83) [Avatar] Offline
#4
Re: 1.3.4 Discussion, editing some internal git files
Glad to be of help. I explain them more in Chapter 3.
yevgeller (4) [Avatar] Offline
#5
Re: 1.3.4 Discussion, editing some internal git files
Ok, I read that chapter. Some pretty nifty features! I did not know about git stash.

Anyway, back to my topic smilie I start a new project, run
> git init
then I need to add .gitignore file, edit it, commit it, and then add the rest of my files so that git does not add extra files, is my understanding correct? This way using the "exclude" file does not seem like such a bad option because it is already there.

And may I also suggest that you mention the extensive syntax of the .gitignore file, such as the following:
[Dd]ebugPublic/

And also there are pre-done gitignore files available at https://github.com/github/gitignore

Thank you.
Mike McQuaid (83) [Avatar] Offline
#6
Re: 1.3.4 Discussion, editing some internal git files
Yes, adding files to it is a bit more involved but has the advantage of being shared with everyone using the project. I'll add some comments about `.gitignore` syntax but they might not make the next MEAP. Thanks for the feedback!
yevgeller (4) [Avatar] Offline
#7
Re: 1.3.4 Discussion, editing some internal git files
Aha! I understand now, the "exclude" file is specific to my machine, but .gitignore lives with the project. That is a very good point, and I totally missed that.

Thank you for such a quick and clear response, and I hope that including bits of syntax into the book will help the readers appreciate that feature. I am looking forward to reading the next MEAP version and learning some more about Git. Thanks a lot!
Mike McQuaid (83) [Avatar] Offline
#8
Re: 1.3.4 Discussion, editing some internal git files
Thanks again for the kind words.