GIT questions and insight needed

GIT questions and insight needed

Scott Karren -
回帖数:7

I currently have a working 2.3.2+ Moodle install with several third party plugins and some custom code.  We use a Windows 2008 server platform with IIS 7.5, MySQL 5.5, and PHP 5.4.

Keeping this site up to date has been an ardous task with regards to making sure that I don't overwrite custom code, making sure that I am using the right versions of the plugins and making sure that everything is working together.

With the thought of streamlining the update process I have been looking at Git and it seems fairly straightforward with the exception of handling contributed third party plugins.  I have been following the instructions at http://docs.moodle.org/23/en/Git_for_Administrators and I am getting stuck at Installing a contributed extension from its Git repository.  I am able to perform the first two commands listed with no issues, when I try to do the third command I get a fatal error that states "Cannot update paths and switch to branch 'MOODLE_23_STABLE' at the same time.  Did you intend to checkout 'origin/MOODLE_23_STABLE' which cannot be resolved as commit?"

Is the idea here that I clone the contrib plugin, then create a new branch and name the branch something different from what I named my Moodle branch, something like "Scotts_test" (for lack of a better term right now)?  Do I need to follow this same process with each plugin that we use (about 6 in total)?  As well, how does this work for custom code and other integrations that require changes to core code?

I have worked with SVN and CVS in the past and feel like I have a good understanding of them, Git is a bit of a mind blow and I am still trying to wrap my head around it.  Any direction and pointers are most appreciated.  I am using msysgit for my Git client.

 

Scott

回复Scott Karren

Re: GIT questions and insight needed

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

Well, I just updated those docs, becuase you can specify the right branch in the inital git clone command, and save some trouble. (git clone -b branch_name repository)

The 'did you intend' bit is telling you exactly what the problem is. There is no MOODLE_23_STABLE branch in the origin repository.

回复Tim Hunt

Re: GIT questions and insight needed

Scott Karren -

Tim

Thank you for the quick reply and the information.  Please forgive my ignorance here, I am trying to understand what I am trying to understand.

I tried the new command and it returned this error "Cloning into 'folder'... fatal: Remote branch MOODLE_23_STABLE not found in the upstream origin"  Is this saying that I do not have a Moodle 23 stable branch created?  If I do a git Status I get "On branch MOODLE_23_STABLE nothing to commit, working clean directory"

So, digging some more and doing a git remote -v I see that origin is the name of the git repository at git.moodle.org, but I am still not understanding why I am getting the error that I am.  I changed to my moodle directory and did a git pull and it pulled the latest 2.3.4 changes down.  What am I missing and you can be brutally honest if you need to be, computer screens hide tears quite well.

Thanks

Scott

回复Scott Karren

Re: GIT questions and insight needed

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

It would help if you could tell us which add-on you are trying to install.

When you type git remote -v in the mod folder, that will show you the remote where you downloaded Moodle from. Not the remote where you tried to download the add-on from.

回复Tim Hunt

Re: GIT questions and insight needed

Scott Karren -

Ok time for specifics, no more hand grenades and horseshoes.  The add-ons that we use are as follows:

Certificate, Questionnaire, Configurable Reports, ILP, Navigation Buttons, OneTopic format, and the Face to Face add-on.

We also use ELIS and a custom theme.  Thank you for your help in getting a hack more informed.

Scott

回复Scott Karren

Re: GIT questions and insight needed

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

That is not very specific. Which one of those plug-ins gives you the error about there not being a 2.3 stable branch when you try to install it?

回复Tim Hunt

Re: GIT questions and insight needed

Scott Karren -

My apologies.  The one that I have tried to install is the Navigation Buttons. I wanted to successfully install one before moving on to the rest.

Scott

回复Scott Karren

Re: GIT questions and insight needed

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

So, look at https://github.com/davosmith/moodle-navbuttons. You will see that there is only a master branch and a MOODLE_19_STABLE branch, so presumably you need to install the master branch if you are any Moodle 2.x. The readme file there confirms that hypothesis, although it could be more explicity.

So, just do a git clone of that repository.