Linux Scroll

Just another WordPress.com site

Manage wordpress with git

Git was initially designed and developed by Linus Torvalds for Linux kernel development. Every Git working directory is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server.

Install git:

$ sudo apt-get -y install git gitk gitosis

Initial:

$ cd wordpress/

$ git-init # initiate git repository
$ git-add . # apply to all files
$ git-status # check status
$ git-commit -m'wordpress initial 2.6.0 upstream' # commit
$ gitk --all

Create branch:

$ git-branch soy  # create new branch soy

$ git-checkout soy # switch to soy branch
$ gitk --all

Start modify:

$ git-checkout soy # switch to soy branch

$ cp -ar soy/wordpress .. # copy full modified copy to soy branch
$ vi wp-content/themes/default/style.css # make changes
$ git-status # check status of repository
$ git-add . # add all new files and changed files
$ git-commit -m'my modIFY' # check in my changes on SOY branch

Upgrade wordpress:

$ git-checkout master  # switch to the master branch

$ tar xzvf wordpress-2.6.2.tar.gz
$ cd wordpress
$ git-status # check status
$ git-add . # add all new files
$ git-commit -m'wordpress 2.6.2 upstream' # commit
$ gitk --all

Rebasing:

$ git-checkout soy # switch to soy branch

$ git-rebase master # stack soy changes on top of master branch
$ gitk --all

$ git-log master..soy  # log

$ git-rebase --continue # continue rebase
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: