1

I am looking for a better description of staging files with git itself (other than Git big commit best practices). I don't need to stash files into smaller commits, ignore files by pattern, etc. What I am looking for is a tutorial that is only about adding files - efficient by browsing through big packs (up to 100) of "unstaged" files and maybe editing them (as hunks).

Command line tricks with pipeline filtering like in

git status -uno --porcelain | gawk '{ print $2 }' | xargs echo | xargs git add

are offtopic.

Bottom line: I am looking for tips to "master" interactive mode and patterns in staging with

git add
Community
  • 1
  • 1
Yauhen Yakimovich
  • 13,635
  • 8
  • 60
  • 67
  • 7
    Pipes aren't "command line tricks". They're integral to using your tools correctly and effectively. By ignoring them you're crippling yourself. – user229044 Jun 08 '11 at 17:35
  • 1
    Pipelining should not be a primary choice, if there is a shorter way (native functionality). My question concerns itself with finding such an alternative with git itself. Please note, it is not about 5-10 files, it is about staging 40-50 of them and they don't have a trivial masking subset. Pipelining costs time to debug up to precise result. That's why I excluded this option from the start. Simply not good enough, sorry. – Yauhen Yakimovich Jun 09 '11 at 09:31
  • 1
    Welcome to the command line. You're not going to enjoy your stay with that attitude. – user229044 Jun 09 '11 at 13:59
  • 1
    @meagar IMO You are completely missing the point ;) My question is about learning git not pipes – Yauhen Yakimovich Jun 09 '11 at 15:39

2 Answers2

9

Why is

git add -p -- some/dir

not good enough?

There is also git-gui

Hope this helps

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141
  • 1
    yep, *git gui* seems to address the problem. But best would be actually a link to blog or a tutorial for an interactive mode. – Yauhen Yakimovich Jun 09 '11 at 09:24
  • 1
    It looks like I was looking for this explanation of interactive mode (http://book.git-scm.com/4_interactive_adding.html), including the revert case. – Yauhen Yakimovich Jun 10 '11 at 10:13
0

Just wanted to mention that now I use in my daily git business

git commit -a

or if I need to make choices the interactive mode with

git add -i
Yauhen Yakimovich
  • 13,635
  • 8
  • 60
  • 67