git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Getting a list of last commit's files and piping them..
@ 2009-09-28 13:02 Ahmed Nuaman, Freelance Designer and Developer
  2009-09-28 14:01 ` Johannes Schindelin
  2009-09-28 14:13 ` Christian Himpel
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmed Nuaman, Freelance Designer and Developer @ 2009-09-28 13:02 UTC (permalink / raw)
  To: git

Hey,

I use git for a local versioning system and was wondering if there was a
way that I could write a bash script that would get the paths of the files
from the latest commit and then pipe them to ftp or ssh for deployment.

-- 


All the best,

Ahmed Nuaman
Freelance Designer and Developer
+44 (0) 7811 184 436
ahmed@ahmednuaman.com
www.ahmednuaman.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Getting a list of last commit's files and piping them..
  2009-09-28 13:02 Getting a list of last commit's files and piping them Ahmed Nuaman, Freelance Designer and Developer
@ 2009-09-28 14:01 ` Johannes Schindelin
  2009-09-28 14:13 ` Christian Himpel
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Schindelin @ 2009-09-28 14:01 UTC (permalink / raw)
  To: Ahmed Nuaman, Freelance Designer and Developer; +Cc: git

Hi,

On Mon, 28 Sep 2009, Ahmed Nuaman, Freelance Designer and Developer wrote:

> I use git for a local versioning system and was wondering if there was a 
> way that I could write a bash script that would get the paths of the 
> files from the latest commit and then pipe them to ftp or ssh for 
> deployment.

If you mean all the files that were touched by the last commit:

	git diff --name-only HEAD^..

If you mean all the files of the latest revision:

	git ls-tree --name-only -r HEAD

Both commands take -z options in which case they delimit the names with 
NULs for better parsability.

Hth,
Dscho

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Getting a list of last commit's files and piping them..
  2009-09-28 13:02 Getting a list of last commit's files and piping them Ahmed Nuaman, Freelance Designer and Developer
  2009-09-28 14:01 ` Johannes Schindelin
@ 2009-09-28 14:13 ` Christian Himpel
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Himpel @ 2009-09-28 14:13 UTC (permalink / raw)
  To: Ahmed Nuaman, Freelance Designer and Developer; +Cc: git

On Mon, Sep 28, 2009 at 02:02:52PM +0100, Ahmed Nuaman, Freelance Designer and Developer wrote:
> I use git for a local versioning system and was wondering if there was a
> way that I could write a bash script that would get the paths of the files
> from the latest commit and then pipe them to ftp or ssh for deployment.

For example, to scp a complete file list from branch `topic' to
`user@server', you could use `rsync' and do something like:

git checkout topic &&
git ls-tree -r --name-only |
rsync -a -e ssh --files-from=- user@server:/path/to/dest

Note, that this is completely untested.  Use at your own risk.


Regards,
chressie

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-09-28 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-28 13:02 Getting a list of last commit's files and piping them Ahmed Nuaman, Freelance Designer and Developer
2009-09-28 14:01 ` Johannes Schindelin
2009-09-28 14:13 ` Christian Himpel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).