Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Stacks/documentation/     Datei vom 28.6.2026 mit Größe 3 kB image not shown  

Quelle  git-howto   Sprache: Unknown

 

How to use git with the stacks project
--------------------------------------

I assume you have cloned the git repository using the command

 git clone git://github.com/stacks/stacks-project.git

Then you will have a directory called stacks. In the rest of this howto we
assume that you have changed directory into stacks.


Warning
-------

It is easy to make mistakes using git, so it is a good idea to back up your
changes by simply copying them somewhere safe before trying something tricky.


Pulling updates
---------------

From time to time type

 git pull

to automatically pull new updates from github


Working on the project (simplest version)
-----------------------------------------

Create a new branch that you will use to make changes to the project.

 git branch newbranch

The reason for doing this is that it is a bit confusing to deal with the
consequences of pulling updates when you have edited the master branch. Switch
to the new branch by using the command

 git checkout newbranch

Of course you can switch back to the master branch by executing

 git checkout master

whenever you want. Making sure that you are on newbranch can be done by typing

 git branch

the branch that has a * next to it is the one you are currently on. Assuming
you are on newbranch, make edits, etc. Whenever you want to add your changes to
newbranch you type

 git commit -a

It brings up an editor where you can write a short commit message. Keep going
like this until you are happy with the result and want to submit your changes.
To do this, make sure you have committed your latest changes, and the type

 git format-patch -n master..newbranch --stdout > my.patch

This creates the file my.patch which you can email to stacks.project@gmail.com
for inclusion in the project.


Keeping in sync with the main repository at github
--------------------------------------------------

If you are worried about keeping in sync with the repository at github you
can do the following steps

 git checkout master
 git pull
 git checkout newbranch
 git rebase master
 
The result of these steps is that the master branch is synced with the master
branch at github and that your branch newbranch is rebased on
this synced version of the master branch. Actually the last step may lead to
``conflicts''. This means that you have edited some lines that have also been
changed in the origin repository (but in a different way). Whenever this
happens you have to ``resolve'' the conflicts. This is done by editing the
affected files A, B,... (you can find them by grepping for <<<< and >>>>),
editing the troublesome spots in A, B,..., marking the file done by

 git add A,
 git add B,
 ...

and then continuing with the rebase procedure typing

 git rebase --continue

until done. Create and email patches using git format-patch as explained above.
(In fact this is the reason for using git rebase instead of git merge.)


More information
----------------

There is a lot more you can do with git. For example you can set it up so that
the maintainer of the stacks project can pull changes directly from your own
repository. To learn more see https://git-scm.com and
https://www.kernel.org/pub/software/scm/git/docs/

Do assign labels to new theorems, propositions, etc., but don't bother to
assign tags.

Messung
CHZG
849810094

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland