Open AllanChain opened 3 years ago
View Post on Blog
git fetch git reset --hard origin/master
git update-index --assume-unchanged exam.ple
git update-git-for-windows
git tag -d tagname git push --delete origin tagname
From https://stackoverflow.com/a/1260982/8810271
.gitmodules
git add .gitmodules
.git/config
git rm --cached path_to_submodule
.git
rm -rf .git/modules/path_to_submodule
git commit -m "Removed submodule <name>"
rm -rf path_to_submodule
From https://stackoverflow.com/questions/39479154/how-can-i-split-a-single-file-from-a-git-repo-into-a-new-repo Use git fast-export.
First, you export the history of the file to a fast-import stream. Make sure you do this on the master branch.
cd oldrepo git fast-export HEAD -- MyFile.ext >../myfile.fi
Then you create a new repo and import.
cd .. mkdir newrepo cd newrepo git init git fast-import <../myfile.fi git checkout
git filter-branch -f --prune-empty --subdirectory-filter path/to/module
From https://stackoverflow.com/a/21694391/8810271
git update-index --chmod=+x foo.sh
View Post on Blog
Force pull
Assume unchanged
Upgrade git for windows
Delete tag
Remove submodule
From https://stackoverflow.com/a/1260982/8810271
.gitmodules
file..gitmodules
changes:git add .gitmodules
.git/config
.git rm --cached path_to_submodule
(no trailing slash)..git
directory:rm -rf .git/modules/path_to_submodule
git commit -m "Removed submodule <name>"
rm -rf path_to_submodule
Split repo
Single File
From https://stackoverflow.com/questions/39479154/how-can-i-split-a-single-file-from-a-git-repo-into-a-new-repo Use git fast-export.
First, you export the history of the file to a fast-import stream. Make sure you do this on the master branch.
Then you create a new repo and import.
Sub Directory
How to make file +x in Git on Windows?
From https://stackoverflow.com/a/21694391/8810271