Difference between revisions of "User:Frank Ralf/Git"

Jump to: navigation, search

Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is available here: Frank Ralf/Git.

(Cloning Moodle to your local installation)
(Creating a remote branch)
Line 30: Line 30:
 
# Change to the correct local branch
 
# Change to the correct local branch
 
# <code bash>git push origin -u MOODLE_19_STABLE</code>
 
# <code bash>git push origin -u MOODLE_19_STABLE</code>
 +
#: Using different names for local and remote branch: <code bash>$ git push origin  local_19_STABLE:MOODLE_19_STABLE </code>
  
 
[[File:Git creating remote branch.png | 600px]]
 
[[File:Git creating remote branch.png | 600px]]
 +
 +
=== Deleting a remote branch ===
 +
$ git push origin :testbranch
 +
http://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-both-locally-and-in-github
  
 
== See also ==
 
== See also ==

Revision as of 18:46, 4 July 2011

Cloning Moodle to your local installation

Git cloning Moodle.png

Maintaining your own contributed code

Setting up a remote repository on GitHub

See the instructions at:

Cloning the remote GitHub repository to your local Moodle installation

  1. Change to the parent folder for your plug-in
  2. Clone the repository:
    git clone https://nakohdo@GitHub.com/nakohdo/moodle-filter_autolinkhijacker.git
  3. Rename the folder to your plug-in's name
  4. Open Git Bash in that folder

Creating a local branch

  1. Open Git Bash in the plug-in folder
  2. Create new branch:
    git branch MOODLE_19_STABLE
  3. Change to the new branch:
    git checkout MOODLE_19_STABLE
    • Both steps in one:
      git checkout -b MOODLE_19_STABLE

Creating a remote branch

  1. Change to the correct local branch
  2. git push origin -u MOODLE_19_STABLE
    Using different names for local and remote branch:
    $ git push origin  local_19_STABLE:MOODLE_19_STABLE

Git creating remote branch.png

Deleting a remote branch

$ git push origin :testbranch

http://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-both-locally-and-in-github

See also

Moodle forum discussions
External resources