Skip to content

Instantly share code, notes, and snippets.

@claudijd
Created September 10, 2012 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save claudijd/3688776 to your computer and use it in GitHub Desktop.
Save claudijd/3688776 to your computer and use it in GitHub Desktop.
Syncing my metasploit-framework fork with upstream-master
#Just a simple script to sync master with upstream-master
#Set rapid7 as remote upstream
puts "[+] Setting Rapid7 as upstream remote"
`git remote add upstream git://github.com/rapid7/metasploit-framework.git`
#Get all the upstream changes
puts "[+] Grabbing upstream remote changes"
`git fetch upstream`
#Switch to the upstream master
puts "[+] Create and Switch to upstream-master"
`git checkout -b upstream-master`
`git checkout upstream-master`
#Switch over to master
puts "[+] Switch to fork master"
`git checkout master`
#Get all changes from master
puts "[+] Grabbing master changes"
`git fetch`
#Rebase against local checkout of upstream master
puts "[+] Rebasing fork's master with upstream-master"
`git rebase upstream-master`
#Push rebased master to github
puts "[+] Pushing changes to fork's master"
`git push origin master`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment