threads / discuss / 2496

Simple questions on GIT usage.

Subject: Simple questions on GIT usage.

## tl;dr

5 messages between Nov 14, 2005 and Nov 14, 2005.

replies: 4people: 3as markdown or json

Franck· Nov 14, 2005, 15:46 UTC · lore
Hi,

I'd like to know how to delete an entire branch and all it's related objects. Is the following correct to accomplish that ?

        # rm -f .git/refs/heads/mybranch
        # git-prune

And a second question is: how to get the tree ID of the working repository ? I know it's very basic but I can't find out the answer in any documentations.

Thanks
--
               Franck
Andreas Ericsson· Nov 14, 2005, 16:08 UTC · re: Franck · lore

Re: Simple questions on GIT usage.

Franck wrote:
Show 5 quoted lines
> Hi,
> 
> I'd like to know how to delete an entire branch and all it's related
> objects. Is the following correct to accomplish that ?
> 
man git-branch
It will tell you about its -d and -D options.
> 
> And a second question is: how to get the tree ID of the working
> repository ?

I get a feeling there's a higher-level question behind this one, like "How can I get a diff between an updated (but not committed) index and the files in the working directory?"

When you have a problem it's usually better to just tell people what sort of end-result you're hoping to achieve and what steps you've taken to accomplish it so far. Asking for details about something that might be wrong thinking from the start won't help you but will still require much of our time to answer. I.e. nobody gains anything but the work still has to be done.

Incidentally, the answer to the quoted question above is (usually)
	git diff-index -p HEAD

Otherwise; man git (and look in the "IDENTIFIER TERMINOLOGY". I wish I had).

and
for i in /usr/bin/git-*tree*; do man ${i##*/}; done
-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Randal L. Schwartz· Nov 14, 2005, 16:37 UTC · re: Andreas Ericsson · lore

Re: Simple questions on GIT usage.

>>>>> "Andreas" == Andreas Ericsson <ae@op5.se> writes:
Andreas> man git-branch
Andreas> It will tell you about its -d and -D options.
It will?  My manpage has no -d or -D option for git-branch.

And I've been looking for something like that too. If I want to abandon a what-if branch, how do I make sure that the branch and all objects are deleted?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Andreas Ericsson· Nov 14, 2005, 16:56 UTC · re: Randal L. Schwartz · lore

Re: Simple questions on GIT usage.

Randal L. Schwartz wrote:
Show 9 quoted lines
>>>>>>"Andreas" == Andreas Ericsson <ae@op5.se> writes:
> 
> 
> Andreas> man git-branch
> 
> Andreas> It will tell you about its -d and -D options.
> 
> It will?  My manpage has no -d or -D option for git-branch.
> 

Ah. It's the help output that has them. I've submitted a patch to add them to the man-page though, so it should show up soonish.

> And I've been looking for something like that too.  If I want to
> abandon a what-if branch, how do I make sure that the branch and all
> objects are deleted?
> 

git branch -D branchname git prune

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Franck· Nov 14, 2005, 16:36 UTC · re: Franck · lore

Re: Simple questions on GIT usage.

Andreas

Could you cc me when you're responding to my questions since I'm not subscribed to the GIT mailing list for now...thanks

git-branch -d option is not documented on online documentation at: http://www.kernel.org/pub/software/scm/git/docs/ That's why I didn't find it by my self...

Regarding the second question, your feeling is wrong. What you described is well documented in the git tutorial. There's no "hidden" question behind the one I posted in my first email. So the question is still: Is there a way to get information about the working repository ? For instance if I create a branch which is not based on the current HEAD position of master branch but instead is based on a previous poisition of master branch. Then later I want to know how I create this branch, how can I get this information ?

Thanks
--
               Franck

← back to recent threads