Re: Finding the name of the parent branch?
- From
- Santi Béjar <santi@agolina.net>
- Date
- Jan 30, 2009, 14:46 UTC
- Message-ID
- <adf1fd3d0901300646h39e27f50pdb6510083284cf8a@mail.gmail.com>
- In-Reply-To
- <a2633edd0901300606ub4c507bocccb6747b436f01f@mail.gmail.com>
2009/1/30 Pascal Obry <pascal@obry.net>:
Show 8 quoted lines
>> At least part of. You have to understand the branch model: >> >> git model: >> * a branch is just a pointer to a commit >> * you cannot say "this commit was done in that branch" >> * what you can say is "this commit is contained in that branch" > > The second point wasn't clear to me.
A practical example:
$ git clone path/to/project.git $ cd project $ git checkout -b bugfix-1234 origin/master $ # hack, hack, hack $ git commit -a -m "Fix for the Bug #1234" $ git push origin HEAD:master
So, you've done a commit in a local branch named bugfix-1234 and once you push it to the master branch in origin there is nothing to tell you so. A commit is defined with the current state, the old commit(s) and some metadata (author and committer) but nothing about which branch it was made, and as a branch is a pointer to a commit there is nothing more.
Santi