Magnus Therning <[email protected]> writes:

At work each project has a few branches related to our gitops setup that mostly are in the way in the daily work. I add negative refspecs to `.git/config` to tell git to ignore them. However, this doesn't remove them from the output of my favourite log command[1]. In order for that to happen I currently manually edit `.git/packed-refs`, removing the mentions of all uninteresting refs.

It does feel like there ought to be a better, less manual and less error prone,
way to get git to clean them out.

Here's a stanza with the added negaitve refspecs for a project I cloned today:

   [remote "origin"]
           url = [email protected]:my-org/my-proj.git
           fetch = +refs/heads/*:refs/remotes/origin/*
           fetch = ^refs/heads/staging
           fetch = ^refs/heads/sandbox
           fetch = ^refs/heads/production
           fetch = ^refs/heads/travis-test-output
           fetch = +refs/notes/*:refs/notes/*
           push = +refs/notes/*:refs/notes/*

Which I later had to go in and manually modify the `.git/packed-refs` for in
order for them to stop showing up.

If there's an even better way to hide away uninsteresting branches I'd love to
hear about it too.

/M

[1]: `git log --graph --decorate --pretty=lola --abbrev-commit --branches
--remotes`

After a bit of searching I found `git update-ref` which seems to solve my problems perfectly!

/M

--
Magnus Therning                   OpenPGP: 0x927912051716CE39
email: [email protected]
@[email protected]       http://magnus.therning.org/

Computers are useless. They can only give you answers.
    — Pablo Picasso

--
You received this message because you are subscribed to the Google Groups "Git for 
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87bl1dj775.fsf%40therning.org.

Attachment: signature.asc
Description: PGP signature

Reply via email to