On Mon, 18 May 2015 22:05:48 -0400
wor...@alum.mit.edu (Dale R. Worley) wrote:

> Konstantin Khomoutov <flatw...@users.sourceforge.net> writes:
> >> My problem is, that I can not see possibility to checkout files
> >> from another branch, based on a filelist from a text file.
> >
> > Once you have a text file with the list of file names,
> > just do
> >
> >   $ git checkout dev
> >   $ while read fname; do \
> >     git checkout local_dev "$fname"; done < dev_files.txt
> Even shorter:
> $ git checkout local_dev $( cat dev_files.txt )


But well, I'm a programmer, and hence when looking at a construct such
as this I'm sort of automatically thinking "what happens if
dev_files.txt contains 1000 lines?" ;-)  I mean, it will blow up on
a file of hefty size while the `while` construct will handle anything
one shovels at it.

But of course your one-liner is great for a simple case.

> If you're not using bash, use:
> $ git checkout local_dev `cat dev_files.txt`

  $() is not a bashism: it's defined in POSIX [1].


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 git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to