github - Cleanup git master branch and move some commit to new branch

Mots clés : gitgithubgit

meilleur 3 Réponses github - Cleanup git master branch and move some commit to new branch

vote vote

94

$ git branch old_master 
$ git checkout old_master $ git push origin old_master 
$ git checkout master $ git reset --hard 037hadh527bn 
$ git pull upstream master 
$ git push origin :master 
$ git push origin master 
vote vote

86

git branch mywork-orig master 
git reset --hard origin/master 
git checkout -b mywork 
vote vote

77

# make sure we're in master git checkout master # create new branch from current master git branch tmp_master # grab most recent changes from upstream w/o applying them git fetch upstream # force reset local master to match upstream/master git reset --hard upstream/master 
git push -f origin master 

Questions similaires