Re: Best way to specify all local branches and all remote branches.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul Gardiner <osronline@xxxxxxxxxx> writes:

> New to git, and often finding it hard to specify the correct
> refs for a command. Here's an example where I was converting
> all the files in all the commits from unix line endings to
> DOS line endings. You can see I've ended up using cd and ls.
> I'm sure there must be a better way.

git-for-each-ref, git-show-ref, git-ls-remote / git-peek-remote.
 
> $ cd /home/public/tmp/git/
> $ yes |rm -r vdos32
> $ git clone /export/git/vdos32.git vdos32
> $ cd vdos32/
> $ for f in `(cd /export/git/vdos32.git/refs/heads; ls)|sed -e
>     '/master/d' -e '/origin/d'`; do git fetch origin $f:$f; done
> $ git-filter-branch --tag-name-filter cat --tree-filter 'find . -type f
>     ! -name \*.gif ! -name \*.ico|xargs unix2dos -q' `(cd
>     .git/refs/heads;ls)`

If you want to fetch all branches, you can specify globbing refspec;
of course if you use separate remotes layout, or mirror layout.

If you want to pass all branches to git command, usually --all would
be enough (sometimes --heads).
 
> With git-filter-branch, I'm surprised I can't use --all.

git-filter-branch is about single branch; I'm not sure if it should
support --all.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux