Git get only a list of recent ie 2 commit

I develop in Windows at home and send my changes to the client. The client does not want any SCM to be installed, so I need to send the files that I changed from the last iteration. I am currently using Subversion with some kind of automation written by myself, this is a combination of windows and GNU / unix utilities. The script looks at these changes, lists which files are being changed, removes duplication, and finally gets a list of files.

@echo off
if (%3) == () goto usage
set TO_REVISION=HEAD
set PUSHNAME=%3-%1

svn log -v -q -r %2 %3 |  sed "s/^[ ^t]*[AM] \/[[:alnum:]_]*\/[[:alnum:]_]*\/\(.*\.[[:alnum:]_]*\)/tar --append --file=%PUSHNAME%.tar \1/" | sed "s/ (.*//g" | sort | uniq | grep -v "config.xml" >> %PUSHNAME%.bat
IF ERRORLEVEL 1 goto error
echo bzip2 %PUSHNAME%.tar>> %PUSHNAME%.bat
echo :: SVN REVISIONS :: %2>> %PUSHNAME%.bat
echo ... %PUSHNAME%.bat generated.
goto done

:usage
echo USAGE: %~nx0 push-file-name from[:to]-revision relative-or-absolute-path
echo See svn log -v -q -r [REV] to view repository log.
goto done

:error
echo ERROR! Check (if exists) output file %PUSHNAME%.bat
goto done

:done

, . Git. subversion Git. . replace svn -v -q -r log in Git manual:-( , , Git -Gurus.

, ,

+3
2

, , :

git diff-index <commit> --name-only

, <commit> .

--name-only . --name-status,

A   debian/control 
M   debian/rules

.

+1
git show HEAD HEAD^

. . git show --help

0

Source: https://habr.com/ru/post/1770486/


All Articles