Skip to content

Instantly share code, notes, and snippets.

View DharmendraRathor's full-sized avatar
🎯
Focusing

Dharmendra Rathor DharmendraRathor

🎯
Focusing
View GitHub Profile
@DharmendraRathor
DharmendraRathor / Git_ReplaceMasterWithNewBranch.txt
Last active May 3, 2018 04:19
Replace branch with master branch in git
You have branch having latest changes “latestBranch” and if you want to override master with latestBranch changes.
Use following commands
1. Checkout latestBranch.
git checkout latestBranch
2. Merge latestBranch with master with strategy as ours. Current branch changes will be used in case of conflicts.
git merge -s ours master
3. Checkout master branch.
@DharmendraRathor
DharmendraRathor / Git_MoveBranchbetweenRepository.txt
Last active May 3, 2018 04:19
Moving branches/tags from one git repository to another
A Moving branches/tags from one git repository to another
1. Clone existing git repo (source repository)
git clone --mirror <source git url>
eg
git clone --mirror git@github.com:source/source.git
2.
got to <folder with name of repo>