[TOC]
Git provides 2 ways to patch the repo, git format-patch
and git diff
also available in source tree
Provide a method to selectively add the commits to the current branch.
# First checkout the target branch
$ git checkout <branch name>
# pick the commit and assign to the current branch
$ git cherry-pick <hash_id>
To cherry-pick all the commits from commit A to commit B (where A is older than B), run:
$ git cherry-pick A^..B
If you want to ignore A itself, run:
$ git cherry-pick A..B
$ git clone --mirror xxx.git
$ git push --mirror xxx.git
$ git submodule add xx.git {folder}
You may need to init after pull
$ git submodule init
git config --global user.name "xxx"
git config --global user.email "xxx"
git clone git@hxxx:xxx.git
cd xxx
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
cd existing_folder
git init
git remote add origin git@hxxx:xxx.git
git add .
git commit -m "Initial commit"
git push -u origin master
cd existing_repo
git remote rename origin old-origin
git remote add origin git@hxxx:xxx.git
git push -u origin --all
git push -u origin --tags