
How do you merge two Git repositories? - Stack Overflow
2009年9月15日 · git commit -m "Moving content of project B in preparation for merge from A" # Now merge A into B git remote add -f A <A repo url> git merge A/<branch> mkdir A # move all …
Moving Git repository content to another repository preserving …
cd repo2 git checkout master git remote add r1remote **url-of-repo1** git fetch r1remote git merge r1remote/master --allow-unrelated-histories git remote rm r1remote After that repo2/master will …
How do I delete a local repository in Git? - Stack Overflow
2009年10月3日 · Delete the .git directory in the root-directory of your repository if you only want to delete the git-related information (branches, versions). If you want to delete everything (git …
Synchronizing a local Git repository with a remote one
2019年2月17日 · git fetch # This updates 'remote' portion of local repo. git reset --hard origin/<your-working-branch> # this will sync your local copy with remote content, discarding …
git tag - How to list all Git tags? - Stack Overflow
2009年6月30日 · You can list all existing tags git tag or you could filter the list with git tag -l 'v1.1.*', where * acts as a wildcard. It will return a list of tags marked with v1.1. You will notice …
How do I rename a Git repository? - Stack Overflow
2010年1月11日 · From the main repo page, the settings tab is on the right, and the repo name is the first item on the page: Github will redirect requests to the new URL. One very nice feature …
git - remote add origin vs remote set-url origin - Stack Overflow
If you don't have a git repo already initiate one with git init git remote -v Check if any remote already exists If Yes then use git remote set-url origin [email protected] :User/UserRepo.git to …
Pull latest changes for all git submodules - Stack Overflow
2022年7月10日 · For git 1.7.3 or above you can use (but the below gotchas around what update does still apply): git submodule update --recursive or: git pull --recurse-submodules if you want …
How do I change the URI (URL) for a remote Git repository?
The below command will change the git fetch url of the repo. git remote set-url origin <your new url>.git The below command will change the git push url of the repo. git remote set-url --push …
Reduce Git repository size - Stack Overflow
git reflog expire --all --expire=now git gc --prune=now --aggressive An even more complete, and possibly dangerous, solution is to remove unused objects from a git repository Note that git …