trouble w/ pushing commits -- resolved



Robert Dodier <robert.dodier at gmail.com> writes:

> OK, I seem to have sorted out the trouble w/ git push ...
> I updated my git installation from 1.5.x to 1.7.x and although
> that in itself didn't change the outcome, the new git version
> gives more informative messages. In particular when I tried
> git checkout master, it said that I had 8 commits which were
> not on any branch, so I should create a branch for them, so
> I did, then I merged that branch into master and then I pushed
> the commits successfully.
>
> A couple of follow-up questions.
>
> (1) if the commits weren't on any branch, where were they?
> I guess I was under the mistaken impression that I had
> committed them to local master.

Because of the way that Git stores revision information, commits
do not need to be on any branch --- rather, Git has the notion of
an anonymous branch, called a detached head.

For example, you can check out a commit via its sha1sum (commit id):

$ git --no-pager checkout 11be1c1fe079f4254fc65ee939cdbdeb2a119275
Note: checking out '11be1c1fe079f4254fc65ee939cdbdeb2a119275'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in
this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command
again. Example:

  git checkout -b new_branch_name

HEAD is now at 11be1c1... Cut out unused special variable TRANSL-MODULES
and associ$


>
> (2) git checkout master said there were 8 commits in question,
> but it only listed 4 (the 4 which were the only outstanding
> unpushed commits to the best of my knowledge) and then it
> only said "and 4 more". How can I find out which commits to
> which it was referring? I looked in the commit log email and
> it only lists the 4 I expected. I looked for unmerged commits
> via git cherry applied to each local branch, but that only finds
> one commit which I have excluded from merging on purpose.

FWIW,

git log -g --after=2011-07-01 --committer=robert_dodier

will log all commits made by you after the first of this month.


-- 
Leo Butler                <l_butler at users.sourceforge.net>
SDF Public Access UNIX System -   http://sdf.lonestar.org