Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Tutorial on using git in Moodle development.

Obsolete:Tutorial on using git in Moodle development: Difference between revisions

From MoodleDocs
m (New page: = Preparing the environment = frame In the examples at this page, you are expected to use the following environment. Check the diagram. At the moment...)
 
mNo edit summary
Line 1: Line 1:
Disclaimer: this tutorial is based on my personal experience with using git in Moodle development process. There are other (and almost certainly better) ways of doing it. See the references at the bottom of the page. Please use the talk page to add/fix something, I will merge it into the tutorial text. --[[User:David Mudrak|David Mudrak]] 12:11, 26 October 2009 (UTC)
= Preparing the environment =
= Preparing the environment =


[[Image:moodle-git-cvs-servers.png|frame]]
[[Image:moodle-git-cvs-servers.png|frame]]


In the examples at this page, you are expected to use the following environment. Check the diagram. At the moment, there are two source code repositories you can use: the main Moodle CVS server cvs.moodle.org and its git mirror at git.moodle.org. While the CVS contains both Moodle core code and the contributed code, the git mirrors the core code only yet (this may be changed in the near future). We also expect you have some server (called nostromo at the diagram) that you and your team members use and that you do the actual developing at the localhost machines.
In this tutorial, you are expected to use the following environment. Check the diagram. At the moment, there are two source code repositories you can use: the main Moodle CVS server cvs.moodle.org and its git mirror at git.moodle.org. While the CVS contains both Moodle core code and the contributed code, the git mirrors the core code only yet (this may be changed in the near future). We also expect you have some server (we will call it "nostromo") that you and your team members use and that you do the actual developing at the localhost machines.


* <code>git clone</code> can be used to create a mirror of the git.moodle.org repository at your server nostromo
Later in this tutorial, you will see how
* <code>git pull</code> can be used regularly to fetch and merge the upstream changes
* <code>git fetch</code> can be used to get the recent changes from upstream to nostromo
* <code>git cvsimport</code> can be used to create your own git mirror of a contributed code (we do not do this yet for you)
* <code>git cvsimport</code> can be used to create your own git mirror of a contributed code (we do not do this yet for you)
* <code>git push</code> can be used to backup your own work and to share it with your friend before you send it upstream (and you will, right? ;-)
* <code>git clone</code> can be used to create a mirror of your nostromo repos at you local machines
* <code>git cvsexportcommit</code> can be used to send your commits for the upstream
* <code>git push</code> can be used to backup your own work and to share it with your friend
* <code>git pull</code> can be used regularly to fetch and merge the work done by your friend
* <code>git cvsexportcommit</code> can be used to send your commits for the upstream (and you will, right? ;-)
 
= Get the core Moodle branches =
 
Make sure you and your team friends have write access to <code>/pub/scm/git</code> at your nostromo server.
 
$ ssh nostromo
$ cd /pub/scm/git
$ mkdir moodle.git
$ cd moodle.git
$ git init --bare
 
This will create a bare repository in the current directory
 
= Appendix =
 
== Credits ==
 
A big thank you to Penny, Dan and Nigel for helping me with my first steps with git.


= See also =
== See also ==
* [[Development:Tracking Moodle CVS with git]]
* [[Development:Tracking Moodle CVS with git]]
* [[Development:Git tips]]
* [[Development:Git tips]]
* [[Using GIT to backup moodledata]]
* [[Using GIT to backup moodledata]]
* [[Development:Git Migration Workflows]]
* [[Development:Git Migration Workflows]]

Revision as of 12:11, 26 October 2009

Disclaimer: this tutorial is based on my personal experience with using git in Moodle development process. There are other (and almost certainly better) ways of doing it. See the references at the bottom of the page. Please use the talk page to add/fix something, I will merge it into the tutorial text. --David Mudrak 12:11, 26 October 2009 (UTC)

Preparing the environment

moodle-git-cvs-servers.png

In this tutorial, you are expected to use the following environment. Check the diagram. At the moment, there are two source code repositories you can use: the main Moodle CVS server cvs.moodle.org and its git mirror at git.moodle.org. While the CVS contains both Moodle core code and the contributed code, the git mirrors the core code only yet (this may be changed in the near future). We also expect you have some server (we will call it "nostromo") that you and your team members use and that you do the actual developing at the localhost machines.

Later in this tutorial, you will see how

  • git fetch can be used to get the recent changes from upstream to nostromo
  • git cvsimport can be used to create your own git mirror of a contributed code (we do not do this yet for you)
  • git clone can be used to create a mirror of your nostromo repos at you local machines
  • git push can be used to backup your own work and to share it with your friend
  • git pull can be used regularly to fetch and merge the work done by your friend
  • git cvsexportcommit can be used to send your commits for the upstream (and you will, right? ;-)

Get the core Moodle branches

Make sure you and your team friends have write access to /pub/scm/git at your nostromo server.

$ ssh nostromo
$ cd /pub/scm/git
$ mkdir moodle.git
$ cd moodle.git
$ git init --bare

This will create a bare repository in the current directory

Appendix

Credits

A big thank you to Penny, Dan and Nigel for helping me with my first steps with git.

See also