Skip to content

Instantly share code, notes, and snippets.

@carstingaxion
Forked from dongilbert/git-wordpress.txt
Created September 23, 2012 12:47
Show Gist options
  • Save carstingaxion/3770568 to your computer and use it in GitHub Desktop.
Save carstingaxion/3770568 to your computer and use it in GitHub Desktop.
From WordPress SVN to GitHub and back to SVN
### Using Git with WordPress Plugin Development ###
# receive revision-number from WordPress Repository
svn log -r 1:HEAD --limit 1 http://plugins.svn.wordpress.org/your-plug-in-name
# clone to local folder
git svn clone -s -r<rev-number> --no-minimize-url https://plugins.svn.wordpress.org/<plugin-path>
# change to directory
cd <plugin-path>
# Pull svn history
git svn fetch
# bring your Git repository up to date with your svn trunk (may take some time)
git svn rebase
# list all branches, local and remote and see what branches exist
git branch -a
# create a new repo "<plugin-path>" via github.com
# add github remote
git remote add origin git@github.com:<your-user-name>/<plugin-path>.git
# push existing files (if there are some) to github
git push origin master
### Do Changes to the repo ###
# Add changed files to the stage
git add *
# commit changes
git commit -m "Starting to code"
# push to github
git push -u origin master
# bring your Git repository up to date with your svn trunk (may take some time)
git svn rebase
# push to svn
git svn dcommit
# tag current branch
git tag -a 0.1 -m "Tagging 0.1"
# switch to tag
git checkout 0.1
# push tag to svn
git svn tag "0.1" -m "Tagging 0.1"
# return to master (or whatever other branch you were working from)
git checkout master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment