FAQ Get,update GIT project sources: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 147: Line 147:
<source lang="bash">
<source lang="bash">
git reset --hard HEAD  
git reset --hard HEAD  
</source>
=Statistics=
To find all changes between a version x and y:
* First, run git merge-base to know the id of last common commit between x and y
<source lang="bash">
git merge-base origin/3.1 origin/develop
</source>
* Then run git log to have list of all changes from last common commit to last commit
<source lang="bash">
git log id_found_at_previous_step..HEAD
</source>
* To get number of added/deleted lines:
<source lang="bash">
git log --numstat --pretty="%H" id_found_at_previous_step..HEAD | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}'
</source>
</source>


More information in GIT usage is available [http://wiki.eclipse.org/EGit/User_Guide here].
More information in GIT usage is available [http://wiki.eclipse.org/EGit/User_Guide here].

Navigation menu