<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://olddev.minetest.org/index.php?action=history&amp;feed=atom&amp;title=Git</id>
	<title>Git - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://olddev.minetest.org/index.php?action=history&amp;feed=atom&amp;title=Git"/>
	<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Git&amp;action=history"/>
	<updated>2026-04-15T10:50:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.7</generator>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Git&amp;diff=52&amp;oldid=prev</id>
		<title>&gt;ROllerozxa at 19:48, 25 January 2023</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Git&amp;diff=52&amp;oldid=prev"/>
		<updated>2023-01-25T19:48:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Git is a version control system.''' It handles projects as ''repositories'' (often called ''repos'') with a history. The history consists of commits. A commit is a change to the code with the description.&lt;br /&gt;
&lt;br /&gt;
Git allows people to create forks of a repository. A fork is a new repository with the same history and content, but when committing to the fork, the main repository is not affected. This allows developers to work on projects without access to the main repo.&lt;br /&gt;
&lt;br /&gt;
To bring other peoples work into the main repository, they can open a pull request. This can easily be done in the GUI of GitHub.&lt;br /&gt;
&lt;br /&gt;
Git also has the ability to create branches in one repository. This allows developers to work on multiple features at the same time.&lt;br /&gt;
&lt;br /&gt;
Minetest has two repositories: the engine is in the “minetest” repository, whereas the main game, Minetest Game, is in the “minetest_game” repositories. The repositories are hosted on GitHub.&lt;br /&gt;
&lt;br /&gt;
== Use Git to get the latest updates ==&lt;br /&gt;
&lt;br /&gt;
You can use Git to get the latest updates of Minetest in a RUN_IN_PLACE version. To do this, clone the main repository:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Get the engine&lt;br /&gt;
git clone https://github.com/minetest/minetest.git # Creates a directory called &amp;quot;minetest&amp;quot; with all the content.&lt;br /&gt;
&lt;br /&gt;
# Get Minetest Game&lt;br /&gt;
cd minetest/games/&lt;br /&gt;
git clone https://github.com/minetest/minetest_game.git # Creates a directory called &amp;quot;minetest_game&amp;quot; with all the content.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get the latest updates of the engine (you have to compile Minetest after this), do this in the cloned Minetest directory:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git pull&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get the latest updates of Minetest Game:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd games/minetest_game/&lt;br /&gt;
git pull&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using Git for development ==&lt;br /&gt;
&lt;br /&gt;
=== Creating a fork ===&lt;br /&gt;
&lt;br /&gt;
{{Template:Note|In this example only the engine repository is used, but you can do the same with the minetest_game repository.}}&lt;br /&gt;
&lt;br /&gt;
To use Git for development, you have to fork the main repository on GitHub first. After this, you can clone your repository:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone git://github.com/Your_user_name_on_GitHub/minetest.git #Creates a directory called &amp;quot;minetest&amp;quot; with all the content&lt;br /&gt;
cd minetest/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Coding a feature or a bug fix ===&lt;br /&gt;
&lt;br /&gt;
Create a new branch to code your feature (be sure to give them good names (not just “patch” or “fix”)):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git checkout -b feature_branch&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you can code your feature or bug fix. If you are done, you have to commit your changes and push them to your repository on GitHub:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git add . # Adds all changes; alternatively you can specify single files&lt;br /&gt;
git commit -m &amp;quot;Your feature&amp;quot;&lt;br /&gt;
git push origin feature_branch&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commit messages should start with a capital letter and use the present tense. They should sum up the feature/fix.&lt;br /&gt;
&lt;br /&gt;
You can now access your code in your repository on GitHub and open a pull request for it to the main repository.&lt;br /&gt;
&lt;br /&gt;
To go back to your master branch do:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git checkout master&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to update your feature, do:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git checkout feature_branch&lt;br /&gt;
# Do changes&lt;br /&gt;
git add .&lt;br /&gt;
git commit -m &amp;quot;Update message&amp;quot;&lt;br /&gt;
git push origin feature_branch&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will automatically be added to the pull request (if there is one).&lt;br /&gt;
&lt;br /&gt;
=== Updating your fork ===&lt;br /&gt;
&lt;br /&gt;
You can use Git to update your Minetest fork with the latest changes of the official repository.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
&lt;br /&gt;
If you haven't already you need to tell git where to get the changes.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git remote add upstream https://github.com/minetest/minetest&lt;br /&gt;
cd games/minetest_game&lt;br /&gt;
git remote add upstream https://github.com/minetest/minetest_game&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Updating the fork ====&lt;br /&gt;
&lt;br /&gt;
You need to download the changes of the main repository first and then merge them.&lt;br /&gt;
&lt;br /&gt;
'''For the engine:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Get the changes&lt;br /&gt;
git fetch upstream&lt;br /&gt;
&lt;br /&gt;
# Merge the changes&lt;br /&gt;
git rebase upstream/master&lt;br /&gt;
&lt;br /&gt;
# Push the result to GitHub&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''For the game:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd games/minetest_game&lt;br /&gt;
# Get the changes:&lt;br /&gt;
git fetch upstream&lt;br /&gt;
&lt;br /&gt;
# Merge the changes&lt;br /&gt;
git rebase upstream/master&lt;br /&gt;
&lt;br /&gt;
# Push the result to GitHub&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
Simplify making commits:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;echo 'git add -A &amp;amp;&amp;amp; git commit -m &amp;quot;$*&lt;br /&gt;
&lt;br /&gt;
$(git status -s)&amp;quot;' | sudo tee /usr/local/bin/gitdirectcommit &amp;amp;&amp;amp; sudo chmod +x /usr/local/bin/gitdirectcommit&amp;lt;/source&amp;gt;&lt;br /&gt;
to make a commit, just do changes in your repository and run e.g. &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;gitdirectcommit my changes&amp;lt;/source&amp;gt;&lt;br /&gt;
Quotes are not needed and the files (their path relative to the repository path) which are changed are annexed to the end of the commit message automatically.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://git-scm.com/book ''Pro Git'' (book)]&lt;br /&gt;
* [https://forum.minetest.net/viewtopic.php?f=3&amp;amp;t=14262 The big git and github Pull Request thread on the forums]&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>&gt;ROllerozxa</name></author>
	</entry>
</feed>