On Fri, Jun 17, 2016 at 6:08 AM, Eliot Miranda <[email protected]> wrote:
> Hi Alistair,
>
> On Thu, Jun 16, 2016 at 1:43 PM, Alistair Grant <[email protected]>
> wrote:
>>
>> On Thu, Jun 16, 2016 at 01:07:23PM -0700, Eliot Miranda wrote:
>> > Hi All,
>> >
>> > so after fixing "git remote get-url origin" to fail over to "git remote
>> > show origin | filter and munge" the culture shock of "git commit -a"
>> > (git
>> > commit does nothing ?!?!?)

What do you mean "nothing" ?
If you do "git status" before and after you should see some difference.
If you mean "why didn't ii push to the server", here [1] is a good
diagram, and the next page also is good, plus this one on branching
mindset change [2] and nice introduction to undoing things [3] (for
your local repo only.)

>>
>> "git commit" will commit anything that has been "git add"ed to the
>> index.  -a is a convenience to automatically stage files that have been
>> modified.
>
>
> What I don't understand is how, or indeed why, one stages modified files.  I
> get that adding files requires informing git.  But why doesn't "git commit"
> commit modified files by default?  Why do I have to use git commit -a to
> include modified files?

Staging is a significant difference of git to svn, so a few opinions
on the benefit of staging [4] [5] [6] [7] is useful.

Personally I like the staging area as a final check to observe what
I'm *really* committing, particularly when my working area has become
a bit messy.  Now as described in one of the links, "git commit -a" is
a way ignore the staging area so git acts more like svn, but here are
some insightful stories from people that were initially annoyed by the
staging area but later found it useful [8] [9].


And btw, a quickstart git/svn cheat sheet [10].

cheers -ben

[1] 
https://www.git-tower.com/learn/git/ebook/en/command-line/appendix/from-subversion-to-git
[2] 
https://www.git-tower.com/learn/git/ebook/en/command-line/branching-merging/branching-can-change-your-life
[3] 
https://www.git-tower.com/learn/git/ebook/en/command-line/advanced-topics/undoing-things

[4] 
http://stackoverflow.com/questions/4878358/why-would-i-want-stage-before-committing-in-git
[5] 
http://programmers.stackexchange.com/questions/69178/what-is-the-benefit-of-gits-two-stage-commit-process-staging
[6] 
http://stackoverflow.com/questions/4878358/why-would-i-want-stage-before-committing-in-git
[7] http://gitolite.com/uses-of-index.html

[8] http://blog.osteele.com/posts/2008/05/my-git-workflow/
[9] http://2ndscale.com/rtomayko/2008/the-thing-about-git

[10] https://www.git-tower.com/blog/git-for-subversion-users-cheat-sheet/

Reply via email to