Git
Merge branch but discard its history
- checkout target branch (e.g.,
master
) git merge --squash SOURCE_BRANCH
Alternative
- check out source branch (e.g.,
ci
) - soft reset to target branch (e.g.,
master
) - commit
- delete
master
& renameci
tomaster
- done!
Sort uncommited files by modification time
Staged:
git diff --name-only --cached | xargs stat -c '%y %n' -- | sort
Modified, unstaged:
git ls-files -m | xargs stat -c '%y %n' -- | sort
Untracked (respecting .gitignore)
git ls-files -o --exclude-standard | xargs stat -c '%y %n' -- | sort
Spin subdirectory off into new repo
This works well: https://stackoverflow.com/a/17864475
(git subtree
is safe, it creates a new branch)