{"thread":{"id":"21080","subject":"Getting a list of last commit's files and piping them..","startedAt":"2009-09-28T13:02:52Z","lastAt":"2009-09-28T14:13:12Z","messageCount":3,"participants":["Ahmed Nuaman, Freelance Designer and Developer","Johannes Schindelin","Christian Himpel"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"123951","messageId":"4f302eef91c72cd4583e0aa4707ab4c0@ahmednuaman.com","threadId":"21080","inReplyTo":null,"subject":"Getting a list of last commit's files and piping them..","fromName":"Ahmed Nuaman, Freelance Designer and Developer","fromEmail":"ahmed@ahmednuaman.com","sentAt":"2009-09-28T13:02:52Z","receivedAt":"2009-09-28T13:02:52Z","isPatch":false,"sender":{"key":"ahmed@ahmednuaman.com","avatar":null},"body":"Hey,\n\nI use git for a local versioning system and was wondering if there was a\nway that I could write a bash script that would get the paths of the files\nfrom the latest commit and then pipe them to ftp or ssh for deployment.\n\n-- \n\n\nAll the best,\n\nAhmed Nuaman\nFreelance Designer and Developer\n+44 (0) 7811 184 436\nahmed@ahmednuaman.com\nwww.ahmednuaman.com\n"},{"id":"123952","messageId":"alpine.DEB.1.00.0909281559001.16710@intel-tinevez-2-302","threadId":"21080","inReplyTo":"4f302eef91c72cd4583e0aa4707ab4c0@ahmednuaman.com","subject":"Re: Getting a list of last commit's files and piping them..","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-09-28T14:01:04Z","receivedAt":"2009-09-28T14:01:04Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 28 Sep 2009, Ahmed Nuaman, Freelance Designer and Developer wrote:\n\n> I use git for a local versioning system and was wondering if there was a \n> way that I could write a bash script that would get the paths of the \n> files from the latest commit and then pipe them to ftp or ssh for \n> deployment.\n\nIf you mean all the files that were touched by the last commit:\n\n\tgit diff --name-only HEAD^..\n\nIf you mean all the files of the latest revision:\n\n\tgit ls-tree --name-only -r HEAD\n\nBoth commands take -z options in which case they delimit the names with \nNULs for better parsability.\n\nHth,\nDscho\n"},{"id":"123954","messageId":"20090928141312.GA4564@mrslave","threadId":"21080","inReplyTo":"4f302eef91c72cd4583e0aa4707ab4c0@ahmednuaman.com","subject":"Re: Getting a list of last commit's files and piping them..","fromName":"Christian Himpel","fromEmail":"chressie@googlemail.com","sentAt":"2009-09-28T14:13:12Z","receivedAt":"2009-09-28T14:13:12Z","isPatch":false,"sender":{"key":"chressie@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/227883?v=4"},"body":"On Mon, Sep 28, 2009 at 02:02:52PM +0100, Ahmed Nuaman, Freelance Designer and Developer wrote:\n> I use git for a local versioning system and was wondering if there was a\n> way that I could write a bash script that would get the paths of the files\n> from the latest commit and then pipe them to ftp or ssh for deployment.\n\nFor example, to scp a complete file list from branch `topic' to\n`user@server', you could use `rsync' and do something like:\n\ngit checkout topic &&\ngit ls-tree -r --name-only |\nrsync -a -e ssh --files-from=- user@server:/path/to/dest\n\nNote, that this is completely untested.  Use at your own risk.\n\n\nRegards,\nchressie\n"}]}