[DG: Open Forum] GIT add question

Charles Severance csev at umich.edu
Mon Oct 15 12:05:53 PDT 2012


I have a question about "git add"

Does "git add" simply add a file to the list of things that will be included in a commit or does it add a particular version of the file to the staging area?

For example if I edited a file and then did a "git add" and then edited the file some more and then did a "git commit" - what would end up being committed?  Only the first edit (before the add) or would both edits end up in the commit?

One of the things I want to do is work one something kind of experimental and have version history that is pretty fine grained while I am fooling around but then when it is all done, I want to roll up all that history into one big commit.

So I think this is what I want to do

(1) make a branch
(2) switch to the branch
(3) hack to my heart's content committing as often as I like

Here is where it gets foggy.

I would like to take everything from my branch and pull it into master but collapse the 20+ commits to my breanch into one commit in the master so I have less to push around to other repos with my software.

Make sense?

/Chuck


More information about the openforum mailing list