This shows you the differences between two versions of the page.
Next revision Both sides next revision | |||
dev:git [2022/01/26 11:37] 127.0.0.1 external edit |
dev:git [2022/04/26 15:06] tomas |
||
---|---|---|---|
Line 98: | Line 98: | ||
curl -k --header %%" | curl -k --header %%" | ||
- | + | ====Scenare==== | |
+ | ==procisteni .git adresare== | ||
+ | Zdroj: [[https:// | ||
+ | ``` | ||
+ | git clone remote-url | ||
+ | for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do | ||
+ | git branch --track ${branch## | ||
+ | done | ||
+ | |||
+ | # | ||
+ | #set -x | ||
+ | |||
+ | # Shows you the largest objects in your repo's pack file. | ||
+ | # Written for osx. | ||
+ | # | ||
+ | # @see http:// | ||
+ | # @author Antony Stubbs | ||
+ | |||
+ | # set the internal field spereator to line break, so that we can iterate easily over the verify-pack output | ||
+ | IFS=$' | ||
+ | |||
+ | # list all objects including their size, sort by size, take top 10 | ||
+ | objects=`git verify-pack -v .git/ | ||
+ | |||
+ | echo "All sizes are in kB. The pack column is the size of the object, compressed, inside the pack file." | ||
+ | |||
+ | output=" | ||
+ | for y in $objects | ||
+ | do | ||
+ | # extract the size in bytes | ||
+ | size=$((`echo $y | cut -f 5 -d ' ' | ||
+ | # extract the compressed size in bytes | ||
+ | compressedSize=$((`echo $y | cut -f 6 -d ' ' | ||
+ | # extract the SHA | ||
+ | sha=`echo $y | cut -f 1 -d ' '` | ||
+ | # find the objects location in the repository tree | ||
+ | other=`git rev-list --all --objects | grep $sha` | ||
+ | # | ||
+ | output=" | ||
+ | done | ||
+ | |||
+ | echo -e $output | column -t -s ', ' | ||
+ | |||
+ | git filter-branch --tag-name-filter cat --index-filter 'git rm -r --cached --ignore-unmatch filename' | ||
+ | |||
+ | rm -rf .git/ | ||
+ | |||
+ | git reflog expire --expire=now --all | ||
+ | |||
+ | git gc --prune=now | ||
+ | |||
+ | git gc --aggressive --prune=now | ||
+ | git push origin --force --all | ||
+ | git push origin --force --tags | ||
+ | ``` | ||