by Devin Yang
(This article was automatically translated.)

Published - 6 years ago ( Updated - 6 years ago )

Forcibly clear all the data of the remote repo and generate a new repo,
Be aware this is a dangerous move , know you know what you are doing.

git init
git add .
git commit -m 'Initial commit'
git remote add origin [repo_address]
git push --mirror --force

Tags: git

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


git

Through the Git attribute, different codes such as big5 and gb2312 are normally displayed at the same time during diff

The problem of garbled characters in different Chinese encodings, here is an example, for example, what will be displayed when there are three php files with different encodings at the same time. Let's look at the results directly through git log -p, and we will find that there are unintelligible garbled characters....

git,Synology

Sharing about gitlab's docker settings

My friend wants to study the operation of gitlab. I said that it takes less than ten minutes to install it with docker image. There is also a gitlab package on my Synology Nas that can be installed directly. As a result, either the installation failed, or it was being repaired, or it was already started and could not be used. @@ Also choked by friends...

git

Yesterday's report of git alias

We can use git config --global alias.[alias] to "reduce the long and long git subcommands that are often executed" into simplified aliases. So you can also add your frequently used git commands to the global git alias through the git alias setting. Let's take a look at my practical example of how to reduce long subcommands into easy-to-use aliases.