Version control problems created GITHUB library.

### 问题1:HTTP Basic: Access denied fatal: Authentication failed:

Reference: https://stackoverflow.com/questions/44514728/http-basic-access-denied-fatal-authentication-failed

Open CMD (Run as administrator) type command:

git config --system --unset credential.helper

then enter new password for Git remote server.

shareimprove this answer

Enter after each GIT must enter a user name and password, there is no problem, test.

 

### issue 2: git file is too big! git thin space. Historical solution growing.

When downloading the source code, very slow, source code only 40MB, but found the hidden .git folder cache version of the library, actually 80MB, and will keep rising. How thin.

When we use every day Git, generally relatively small project, we may not notice .git this file.

In fact, .git file is mainly used to record each variation submitted, when our project more and more, we find .git files increases.

Probably because a lot of large files submitted, if you submit a large file, it will release later even if you delete it, however,

In fact, the record of large files still exist.

why? Think carefully, though you delete large files in a later version, but there is a version of Git reverse function of it, so if a large file is not recorded,

git what is to give you a fallback it? However, the problem caused by the growing .git file is: pull every project has to spend a lot of time, and everyone should spend

So much time. .

git gives the solution using git branch-filter to traverse the git history tree, you can permanently delete the history of large files, to let .git file-loss purposes.

Here are the steps (these steps are very dangerous operation need to be cautious! Do not delete the company ha ha)

First, find out the top five in the git files: 

git verify-pack -v .git/objects/pack/pack-*.idx | sort -k 3 -g | tail -5

Implementation of the results actually look like this:

The first line of the letter is the equivalent id document, you can find out the id corresponding file name with the following command:

git rev-list --objects --all | grep 8f10eff91bb6aa2de1f5d096ee2e1687b0eab007

Well, the biggest files found. How to delete it?

git filter-branch --index-filter 'git rm --cached --ignore-unmatch <your-file-name>'
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git fsck --full --unreachable
git repack -A -d
git gc --aggressive --prune=now
git push --force [remote] master
First of all, there's two most important command is git filter-branch and gc, filter-branch really clean up, but it is useless to run only need to delete files backed up, repackaged and the like, the last command gc ,

 

Used to collect waste generated, and ultimately remove large files.

In one step, and then look at your .git file, there is no surprise it!

 

Guess you like

Origin blog.csdn.net/wlanye/article/details/92632262
Recommended