Git tricks: Difference between revisions

From Mike's wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 13: Line 13:
=== updating submodules ===
=== updating submodules ===
$git submodule update --remote
$git submodule update --remote
=== Adding a sub module ===
git submodule add <nowiki>https://github.com/chaconinc/DbConnector</nowiki>
=== Clean repository ===
git clean -xfd
=== Clean submodules ===
git submodule foreach --recursive git clean -xfd
=== Remove all changes ===
git reset --hard
=== Remove all changes from submodules ===
git submodule foreach --recursive git reset --hard
=== setup submodules ===
git submodule update --init --recursive

Latest revision as of 10:46, 9 January 2023

getting differenc

From last pull

$ git diff HEAD $ git diff @~

between now and previuos release

$ git diff --name-status HEAD~1..HEAD

Resetting - remove all changes.

$ git reset --hard

updating submodules

$git submodule update --remote

Adding a sub module

git submodule add https://github.com/chaconinc/DbConnector

Clean repository

git clean -xfd

Clean submodules

git submodule foreach --recursive git clean -xfd

Remove all changes

git reset --hard

Remove all changes from submodules

git submodule foreach --recursive git reset --hard

setup submodules

git submodule update --init --recursive