tadd git notes - wiki - knowledgebase of randomness HTML git clone git://parazyd.org/wiki.git DIR Log DIR Files DIR Refs --- DIR commit c090ede63bb7af6c7e2a76c8d91b2781aed3270d DIR parent c40cdd1fad9c6beb79dc701b8edde605b3cecb08 HTML Author: parazyd <parazyd@dyne.org> Date: Thu, 16 Feb 2017 00:51:31 +0100 add git notes Diffstat: A Git.wiki | 42 +++++++++++++++++++++++++++++++ M index.wiki | 3 +++ 2 files changed, 45 insertions(+), 0 deletions(-) --- DIR diff --git a/Git.wiki b/Git.wiki t@@ -0,0 +1,42 @@ += Git Knowledgebase = + +== overwrite pull == + + git fetch --all && git reset --hard origin/master + +== remove branches that have been merged with master == + + git branch --merged master | grep -v '^\*' | xargs -n 1 git branch -d + git branch --merged master | grep -v '^\*\| master' | xargs -n 1 git branch -d # will not delete master if master is not checked out + +== stage parts of a file instead of it all == + + git add -p + +== archive the master branch == + + git archive master --format=zip --output=master.zip + +== clean the files from gitignore == + + git clean -X -f + +== marks your commit as a fixup of a previous commit == + + git commit --fixup <SHA-1> + +== squash fixup commits normal commits == + + git rebase -i --autosquash + +== git undo == + + git config --global alias.undo '!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f' + +== blame on certain range == + + git blame -L <start>,<end> + +== backup untracked files == + + git ls-files --others -i --exclude-standard | xargs zip untracked.zip DIR diff --git a/index.wiki b/index.wiki t@@ -14,3 +14,6 @@ Managed with [vimwiki](https://github.com/vimwiki/vimwiki) == Data == * [[JSON]] + +== Misc == +* [[Git]]