Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2014-10-04 19:48:01

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 960
Website

Re: Textpattern moves to Git and GitHub

For those of us who are git novices, can you point us to a “how-to” for installing texpattern via command line like we had for svn?

(for example, once set up, “svn update” made it pretty easy to run the latest and greatest :) I presume there’s something similar with Git?)

Thanks!

Offline

#12 2014-10-04 21:09:54

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,629
Website

Re: Textpattern moves to Git and GitHub

To obtain the repository the first time, issue:

git clone https://github.com/textpattern/textpattern.git dev

Similar to svn checkout, it’ll download the repo and create a folder called dev (in this case) to put it in. Upload the project as usual to your host, minus the hidden .git folder to play with it or even use it directly in your *amp environment.

Thereafter, any time you want to update to the latest and greatest bleeding edge code, make sure you’re in the dev folder and issue:

git pull

to fetch and merge the changes. That’s pretty much it, at least for the master branch.

We’ll be working on feature branches a lot as we test code ready for merging into the main master branch. If you want to play with those, you can check them out into your local repo. If you issue git branch -a you’ll see a list of all available branches. If you like the sound of one, it’s as simple as:

git checkout -b branch_name origin/branch_name

That’ll pull it down to your repo and switch to it so you can play. Your local repo immediately reflects the code in the new branch. You switch between branches using git checkout name-of-branch and you can do this willy-nilly as long as the branch you’re leaving is clean (i.e. has no edits waiting to be committed).

To contribute, fork the repo using git clone into your own Github account, make local changes on your fork, test them, use git add . to add the changed files and git commit to write them to your local repo. git push will sync them back to your Github account, whereby you can issue a pull request to the Textpattern repo for us to review your code and merge it in.

I’m not sure if a pull request can be done directly from the command line or if you have to do it via your own Github fork, as above. There may be a shorter way: I’m sure someone will divulge it if I’m out-of-date.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#13 2014-10-04 21:14:24

gaekwad
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,481

Re: Textpattern moves to Git and GitHub

Also, if you’re new to Git(Hub), their GUI apps are an excellent way to get started:

Offline

#14 2014-10-04 21:28:01

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,629
Website

Re: Textpattern moves to Git and GitHub

gaekwad wrote #284543:

if you’re new to Git(Hub), their GUI apps are an excellent way to get started

Yes, they’re great. I started that way. The only reason I switched to the command line (besides being a keyboard geek) is that Github for Windows assumed that any changes I made were to form part of the next commit. That didn’t matter all the time I was a read-only user, but as soon as I started writing, contributing and patching, it became a slight annoyance to my way of working.

As an example, sometimes I’ll tweak a few files to set up debugging or temporarily change a few supporting tracked files, but don’t want those files to become part of the commit. With the command line I can selectively git add path/to/file-or-folder on a file-by-file or folder basis and then commit them, leaving the supplemental files as-is until such time as I revert them with git checkout -- name-of-file. The GUI wouldn’t let me do that without unchecking individual file names with the mouse, which became tiresome. And sometimes it wouldn’t let me revert changes, which I never fathomed. Things may have moved on since then, but I’m used to the CLI now and find it very quick.

But on the whole, the GUIs are highly recommended as a simple introduction to the wonderful world of git, as Pete says.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#15 2014-10-04 22:12:57

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 960
Website

Re: Textpattern moves to Git and GitHub

Thanks for how-to and the advice Stef and Pete! It is very much appreciated.

Offline

#16 2014-10-05 05:55:53

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,653
Website

Re: Textpattern moves to Git and GitHub

Stef, Pete, do you know any tutorial about git & github? I know all the cool kids are saying that it is fairly easy but it remains to be seen if that is the case for cool-grumpy old men like me.
(I’m reasonably familiar with SVN and Mercurial, and use the latter for tracking personal projects)

Offline

#17 2014-10-05 08:18:05

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 344
Website

Re: Textpattern moves to Git and GitHub

A book that helped me a lot: Git Reference.
You may want to start directly from chapter 2.

Offline

#18 2014-10-05 08:32:39

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,192
Website

Re: Textpattern moves to Git and GitHub

Also bear in mind that branches of Textpatterm might not be too stable, or even guaranteed to become part of the master trunk. It’s where we do development work in progress. Still, feel free to run and test and contribute to them though.

Offline

#19 2014-10-05 09:02:38

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,653
Website

Re: Textpattern moves to Git and GitHub

@CeBe – thanks!

Offline

#20 2014-10-05 20:24:39

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,435
Website

Re: Textpattern moves to Git and GitHub

And another free tutorial: www.git-tower.com/learn


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB