Source code management/fr

Notre principal outil de gestion de code est git. Cet article explique comment l'utiliser et les règles générales qui s'appliquent dans le cas de FreeCAD. Il est fortement recommandé d'apprendre comment fonctionne git (il existe beaucoup d'informations et de tutoriels à propos de git sur internet) avant de travailler avec le code source de FreeCAD.

Il existe également de nombreux bons clients graphiques pour git, comme par exemple git-cola, qui rendent le processus de management des dépôts git plus facile. Il existe également une introduction superficielle au "Développement de FreeCad avec GitKraken"

Accès au code source
Tout le monde peut accéder et obtenir une copie du code source de FreeCAD, mais seulement les managers du projets ont les droits d'écriture. Vous pouvez obtenir une copie du code, l'étudier et le modifier autant que vous le souhaitez, mais si vous voulez faire des modifications que vous souhaitez voir incluses dans les sorties officielles, vous devez effectuer un "pull request" via la section "pull requests" du forum FreeCAD.

Everybody can access and get a copy of the FreeCAD source code, but only the FreeCAD project managers have write access to it. You can get a copy of the code, study it and modify it as you wish, but if you want your changes to be included in the official source code, you need to perform a "pull request" against the master repository so that your modifications can be reviewed by the managers. This style of development is known as the Dictator and lieutenants workflow, as the core developers (dictators) and trusted developers (lieutenants) filter the code that is submitted by independent developers and users.

If your source code changes are significant, you are advised to explain them in the pull request section of the FreeCAD forum.



Dépôt officiel Github
Un façon simple de commencer à travailler avec le code source de FreeCAD est d'utiliser le dépot officle FreeCAD

In order to contribute code, you need to have a GitHub account.

Configuration de votre nom d'utilisateur git
Les utilisateurs doivent faire un commit vers leur dépôt de projet, en utilisant leur nom d'utilisateur GitHub. Si ce n'est pas déjà fait globalement, vous pouvez le régler au niveau local pour le dépôt Git actuel comme ceci :

Note sur les dépôts distants
Veuillez lire quelques informations pour vous aider à mieux comprendre la différence entre ce que origin et upstream signifient dans le contexte de git. Cette section explique comment définir les dépôts Git distants en upstream et origin. En gros: Par conséquent, sur la base de ce qui précède, il existe 2 méthodes principales pour configurer votre environnement git: Nous recommandons la 1ère méthode pour la raison mentionnée ci-dessus.
 *   = votre fork du compte git FreeCAD alias https://github.com/GITHUB_USERNAME/FreeCAD.git
 *   = le dépôt git officiel FreeCAD alias https://github.com/FreeCAD/FreeCAD.git
 * Ceci est important à comprendre car si vous clonez  directement à partir de l', votre origine sera indiquée comme https://github.com/FreeCAD/FreeCAD.git. Si vous faites cela accidentellement, vous pouvez utiliser la commande   pour remédier à la situation.
 * 1ère méthode: forkez sur GitHub et clonez votre fork localement
 * 2ème méthode: clonez un officiel de FreeCAD directement sur votre machine locale

This distinction is important, as you should write code in your own copy of the repository first, before pushing those changes to the official repository.

Based on the above, there are two ways to setup your Git development environment:
 * 1st Method: fork on GitHub and clone your fork locally
 * 2nd Method: clone FreeCAD directly to your local machine, and adjust the remote servers

We recommend the 1st method because it's one step faster.

1ère méthode: forker sur GitHub et clonez votre fourchette localement
Cette méthode est recommandée car elle nécessite moins d’étapes. Vous allez pour l'essentiel forker le dépôt FreeCAD sur votre propre compte GitHub puis cloner localement le dit fork de GitHub. Ensuite vous définissez votre dépôt upstream dans git. La procédure est la suivante:  Vous inscrire pour un compte GitHub si vous n'en avez pas déjà un Allez sur le dépôt FreeCAD: https://github.com/FreeCAD/FreeCAD En haut à droite de la page, recherchez et appuyez sur le bouton "Fork" (il s'agira essentiellement de copier le dépôt officiel FreeCAD sur votre dépôt personnel GitHub: https://github.com/GITHUB_USERNAME/FreeCAD.git) Sur votre machine, clonez votre fork FreeCAD nouvellement créée en ouvrant un terminal et en tapant: git clone https://github.com/GITHUB_USERNAME/FreeCAD.git  Une fois le processus de clonage terminé, définissez maintenant votre   dépôt à distance (voir "Note sur les dépôts distants"). Trouvez où sont placés vos répertoires git distants. Taper   et ca devrait ressembler à: [foo@bar FreeCAD]$ git remote -v origin	https://github.com/GITHUB_USERNAME/FreeCAD.git (fetch) origin	https://github.com/GITHUB_USERNAME/FreeCAD.git (push)  Maintenant, configurez votre   dépôt [foo@bar FreeCAD]$ git remote add upstream https://github.com/FreeCAD/FreeCAD.git  Vérifiez de nouveau et la aussi ca devrait ressembler à: [foo@bar FreeCAD]$ git remote -v origin	https://github.com/GITHUB_USERNAME/FreeCAD.git (fetch) origin	https://github.com/GITHUB_USERNAME/FreeCAD.git (push) upstream	https://github.com/FreeCAD/FreeCAD.git (fetch) upstream	https://github.com/FreeCAD/FreeCAD.git (push)   Nous pouvons maintenant commencer à nous développer. Rendez vous sur "Processus de développement Git"</li> </ol>

First you will fork the FreeCAD repository in GitHub, then clone this personal fork to your computer, and finally set the repository.
 * Log in to your GitHub account.
 * Go to the official FreeCAD repository: https://github.com/FreeCAD/FreeCAD
 * In the top right of the page press the "Fork" button. This will create a personal copy of the FreeCAD repository under your GitHub username:
 * On your machine, clone your newly created FreeCAD fork. It will be created inside a directory.


 * Once the download is complete, enter the new source directory and set the repository.


 * Confirm your remote repositories with ; the output should be similar to this


 * Now development can begin.

2ème méthode: clonez le dépôt officiel FreeCAD git sur votre ordinateur local
Cette méthode de configuration de votre environnement git nécessite quelques étapes supplémentaires, puis la première méthode. Vous clonerez le dépôt FC git directement sur votre machine locale, puis modifierez vos dépôts distants via le terminal. La procédure est la suivante: <ol> Clonez le code FreeCAD avec git: git clone https://github.com/FreeCAD/FreeCAD.git </li> Créez un compte sur un serveur git public (GitHub, GitLab, etc ... pour nos besoins, nous supposons que c'est GitHub)</li> Repérez où sont placés vos répertoires git distants: git remote -v </li> Cela retournera quelque chose qui ressemble à ce qui suit: [foo@bar FreeCAD]$ git remote -v origin https://github.com/FreeCAD/FreeCAD.git (fetch) origin https://github.com/FreeCAD/FreeCAD.git (push) </li> Comme expliqué ci-dessus "Note sur les dépôts distants" vous devez modifier ces adresses de dépôt git distantes. Donc configurez votre   distant: [foo@bar FreeCAD]$ git remote add origin https://github.com/GITHUB_USERNAME/FreeCAD.git </li> Puis nous configurons notre   distant: [foo@bar FreeCAD]$ git remote add upstream https://github.com/FreeCAD/FreeCAD.git </li> Vérifiez de nouveau et la aussi ca devrait ressembler à: [foo@bar FreeCAD]$ git remote -v origin	https://github.com/GITHUB_USERNAME/FreeCAD.git (fetch) origin	https://github.com/GITHUB_USERNAME/FreeCAD.git (push) upstream	https://github.com/FreeCAD/FreeCAD.git (fetch) upstream	https://github.com/FreeCAD/FreeCAD.git (push) </li> Nous pouvons maintenant commencer à nous développer. Rendez vous sur "Processus de développement Git"</li> </ol>

First you will fork the FreeCAD repository in GitHub, however, you will clone the original FreeCAD repository to your local machine, and then alter your remotes via the terminal.
 * Log in to your GitHub account.
 * Go to the official FreeCAD repository: https://github.com/FreeCAD/FreeCAD
 * In the top right of the page press the "Fork" button. This will create a personal copy of the FreeCAD repository under your GitHub username:
 * Clone the original FreeCAD repository. It will be created inside a directory.


 * Once the download is complete, enter the new source directory and set the repository.


 * Then set up the repository.


 * Confirm your remote repositories with ; the output should be similar to this


 * Now development can begin.

If for some reason the remote repositories exist but point to the wrong address, you can remedy the situation by renaming the remote repository's name. For example, should point to your personal fork; if it is pointing to the original FreeCAD repository, change the name of this remote to, and manually add the  repository.

You can also show more information with the keyword.

Ramifications
Une caractéristique importante de Git, est qu'il est extrêmement facile de travailler avec des branches, et, les fusionner. La meilleure pratique recommande de créer une nouvelle branche à chaque fois que vous voulez travailler sur une nouvelle fonctionnalité.

Création d'une branche se fait avec :

Instead of working on the master version of the code, best practices with Git recommend creating a new branch whenever you want to work on a new feature. Branches are inexpensive, they don't copy the entire source tree, but merely create a point in time on top of which you will write code; thus branches help keep work in progress separate from the main code.

Using a new branch is done in two steps, first your create the branch, and then you switch to it:

ou, les deux opérations en un seule :

vous pouvez toujours vérifier, dans quelle branche vous êtes avec :

After you've made changes and committed those changes use the operation with the following options to visualize the branches

Soumettre
Une fois que vous avez fait un peu de travail, validez le avec :

Once you are inside a new branch, edit the source files that you want with a text editor. To see which files were modified use the and  operations; when you are satisfied with the modifications, save the changes with the  operation:

Contrairement à SVN, vous devez informer avec précision les fichiers à envoyer (ou la totalité avec l'option -a). Votre éditeur de texte s'ouvrira, pour vous permettre d'écrire un message de validation.

Alternatively add the message in the commit itself

Rédaction de bons messages de commit
Vous devriez essayer de travailler en petites sections. Si vous ne pouvez pas résumer vos modifications en une seule phrase, il y a probablement trop longtemps, que vous avez fait un commit. Il est également important de donner une descriptions détaillée, et, utile de votre travail. Pour les messages de commit, FreeCAD a adopté un format qui est mentionné dans le livre Git Pro.

For big changes, it is important that you have helpful and useful descriptions of your work. FreeCAD has adopted a format mentioned in the Pro Git book, which consists of a short message, and then a larger descriptive paragraph.

Court sommaire des changements (50 caractères ou plus)

Si nécessaire, bien détailler les textes explicatifs. Ecrivez-en environ 72 caractères ou plus. Dans certains cas, la première ligne est considérée comme l'objet (résumé) d'un email, et, le reste du texte comme le corps. Laisser une ligne blanche pour séparer le résumé, du corps du message (sauf si vous omettez l’entièreté corps); des outils comme rebase peut se confondre si vous exécutez les deux ensemble.

Les paragraphes supplémentaires, viennent après les lignes vides. * Les puces sont très bien aussi - En général, un trait d'union ou un astérisque est utilisé pour la puce, précédé d'un  espace unique, avec des lignes blanches entre les deux, mais ici les conventions varient.

Si vous faites beaucoup de travaux connexes, il a été suggéré ici, que l'on doit faire autant de commits que possible, grand ou petit, dans le sens que vous utilisez des messages avec de courtes phrases. Lorsque vous souhaitez faire une fusion, faites un journal '''log master git .. BRANCH''', et, utilisez la sortie comme une base, pour la qualité de votre commit message. Ensuite, lorsque vous effectuez la fusion, utilisez l'option --squash, et, engagez avec le message de validation (commits) de qualité. Cela vous permettra d'être très libéral avec votre commit, et, aidez à assurer un bon niveau de détails des messages de commit sans faire trop de descriptions distinctes.

to see the individual commit messages. Then you can write a high quality message when performing a merge.

When you merge to master use the option and commit with your quality commit message. This will allow you to be very liberal with your commits and help to provide a good level of detail in commit messages without so many distinct descriptions.

Squashing commits
Squashing refers to the process of combining various consecutive commits into one. This may be desirable if you made many small commits that you want to present as a single commit, for example, when changing a single variable, correcting spelling mistakes, and adjusting the spacing of the code. You should squash only small commits to a single file; big changes to the code across multiple files should contain the full commit history.

With you can see many commits in sequence, with the newest commit on top. In this example, starting from "feature A" many commits are made to implement "feature B"; we would like to squash all commits belonging to "feature B" into one.

Use the operation with the  option to select various commits and squash them. Use the hash of the commit just before the first one that you want to squash, in this case the one corresponding to "feature A".

The command line editor, like or, will open to show you the commits again, now with the older commit on top. Before each commit, the word will be shown. Delete the word, and write the word or just the letter  instead, with the exception of the first entry; this commit is the oldest one, so all future commits will be squashed into it.

Save the file and close the editor.

The editor will open up again. Now you can add a longer message that describes all changes as if they were a single commit. Save the file and close the editor once more. This will finish combining those commits into one, with the new commit message that you wrote.

You can use again to observe the new commit history. In this case only a single commit for "feature B" will appear, on top of the unmodified commit for "feature A".

Publication de votre travail sur "sourceforge repository"
Après avoir fait des modifications sur votre branche locale, et, l'engager (commit) (cela signifie s'engager localement), vous pouvez envoyer votre référentiel sur le serveur. Cela ouvre votre branche au public, et, permet aux principaux développeurs d'examiner, et, d'intégrer votre branche en "maître".

The local branches in your computer aren't automatically synchronized with the remote servers that you have specified as or  (see Remote repositories); you have to explicitly push the branches to the remote servers, for which you must have write access. Once you do this, the branches become public, and available for review by other developers.

Pour plus d'informations sur ce sujet, veuillez consulter https://help.github.com/articles/pushing-to-a-remote/

The regular developer doesn't have write access to the repository https://github.com/FreeCAD/FreeCAD, therefore, you shouldn't push code to this remote server.

Rebasing from upstream
While you work on your own branch, the official FreeCAD code keeps "moving forward" with commits from other developers, and thus starts diverging from the code that you have in your personal fork. .-A origin/myNewBranch / -o---Z FreeCAD upstream/master

Therefore, when you are ready to merge your branch to the main FreeCAD repository, you must "rebase" your own copy of the repository, so that it is as close as possible to the official repository. See Git Branching - Rebasing for more information.

This will download the code from the branch of the  repository (the official FreeCAD source), and will merge it with your current branch, so that your changes will appear on top of the latest official code. If nobody modified the same files that you did, then the merge will succeed without problems. If some files were changed at the same time by different people, there may be a conflict that needs to be resolved. .-A' origin/myNewBranch / -o---Z FreeCAD upstream/master

To summarize, you need to be in the appropriate branch, rebase the upstream code, and then proceed with the push.

The operation is equivalent to a  followed by a. When the option is used, instead of doing a simple, it runs the  operation.

Merging the branch (pull request)
Once you have committed your changes locally, rebased your branch from the upstream repository, and pushed your branch online, you can initiate a "pull request". A pull request tells the administrators of the official FreeCAD repository that you want to merge the new code in your branch with the official code.

As soon as you push the code to your repository, GitHub will give you the option of comparing and creating a pull request against the  repository. By pressing you will open an interface that will allow you to pick which repository is the "base", target of the merge, and which is the "head", your additional code. A quick check will be done by the system telling you if there are no conflicts with the files that you modified; if you worked on files that nobody has touched, your branch will be able to merge cleanly. In addition, it will show you a text editor so you can write a message documenting your changes; it will also display the number of commits in your branch, the number of files that were modified, and a view showing you the differences between the "base" and the "head" so that everybody can immediately see your intended modifications.

Click to proceed. A message will appear indicating that some checks need to be done on the code. This is a system that compiles FreeCAD automatically and runs the unit tests. If the tests pass, the pull request will have a better chance of being merged into the main code, otherwise a report will be made indicating the errors encountered. See FreeCAD pull requests. Some checks haven’t completed yet


 * continuous-integration/travis-ci/pr Pending — The Travis CI build is in progress |Required|

If the tests succeed, you will see a message such as the following All checks have passed


 * continuous-integration/travis-ci/pr — The Travis CI build passed |Required|

This branch has no conflicts with the base branch Only those with write access to this repository can merge pull requests.

Now you must wait for the administrators to merge your branch; you will be notified when this happens.

If you wish, you may delete the branch that was just merged, or even your entire FreeCAD fork, as your own code is already included at the end of the master branch.

you may continue working on the same branch while you wait for merge approval; if you  again, a second merge commit will be queued in the same pull request, and another automated test will be done. That is, while your merges aren't yet approved by the administrators, you may keep pushing changes to your repository, and this will queue those commits in the same pull request to the  repository. Using a single pull request to queue many individual commits is often desirable for small changes. For big additions to the source code, you should create another branch, develop your features there, and then submit a separate pull request for this branch.

The pull request interface can be used whenever you want to submit code from your own repositories to another repository in GitHub. You can use it to merge code in the opposite direction as well, from other people's branches to your own, or even between your own branches. In the last case, since you own the branches, the merges can be approved by yourself immediately.

Keeping the GitHub repository up to date
Once you've forked FreeCAD, your personal repository exists independently from the original. When the original repository has new commits, GitHub will inform you that your personal repository is behind in number of commits:

In similar way, if you created a development branch with new code, GitHub will inform you that this branch is ahead in number of commits; that is, this branch has changes that haven't been merged into the official FreeCAD repository:

While developing, both cases are possible, as your own branch may lack commits made by other developers, but include new commits by you:

When developing code it is recommended that you rebase the branch in which you are currently working, as that will put your branch always ahead of the FreeCAD master code.

As for your original branch, it will never be automatically updated by GitHub; this is something that you must do yourself. Switch to the branch, then  from  (which performs a  and ), and then push this updated  branch to your remote  repository.

After this is done, GitHub will let you know that your are synchronized with the repository.

Now that your is up to date, you may decide to switch to it, and delete the other branch that you used previously to develop a feature.

To delete the branch in the remote repository, you can use the  action. Normally, you push a local branch; this creates a remote branch with the same name as your local branch.

However, if you use the notation, the local branch is created in the remote repository under a different name:

Therefore, you can delete the remote branch by pushing an empty local branch:

Now that you only have an up-to-date, you can create a new branch, and repeat the steps of changing files, committing, pushing, submitting a pull request, merging, and updating.

If you don't want to delete your already custom branch, you may force updating it to be equal to the updated ; then you can do whatever you want with it, including adding more commits and pushing it to the remote repository.

Hard resetting a branch like this is usually not needed. In most cases, you want to follow the sequence of creating a new branch, committing changes, pushing those changes, merging the branch, and then deleting the branch.

Résolution des problèmes de merge
https://gist.github.com/piscisaureus/3342247

Résolution des conflits de fusion

 * explications git-scm sur la manière dont les conflits sont présentés
 * Article de GitHub sur la résolution des problèmes de merge par la ligne de commande
 * Personnalisez votre outil de merge préféré lorsque vous rencontrez un conflit entre plusieurs git.

Merging local branches with will occasionally present conflicts, as the files may have been changed at the same time in the same place. If this happens you should fix the files, and re-merge.


 * How merge conflicts are presented with
 * Basic merge conflicts and Git Tools - Advanced Merging
 * Resolving a merge conflict using the command line
 * External merge and diff tools to use when you encounter a Git conflict.

Inspect the changes of a single file through various commits:

Création de correctifs à partir de git
Il est parfois nécessaire de créer un patch au lieu de soumettre un PR. Le flux de travail suivant explique comment procéder: <ol>  Assurez-vous d’être dans la bonne branche (c’est-à-dire pas dans la branche principale) en vérifiant avec git branch -v</ pre> </li>  Créez le patch: we do this by using the git format-patch command which we patch against the master branch and redirect to STDOUT. Nous créons le patch dans le répertoire en dehors de la source (afin de ne pas polluer le répertoire source lui-même, ceci est facultatif car vous pouvez choisir l'emplacement où vous voulez que le patch soit créé) git format-patch master --stdout> ../patch.name.patch </li>  Une autre méthode consiste à utiliser git format-patch HEAD^ ou git format-patch HEAD~1. Le ^ ou 1 peut être changé en nombre de commits devant être couverts, à savoir: ^^^ ou ~ 3. git format-patch HEAD^ </li> Il créera un patch ou une série de patchs avec le format de nom de fichier XXXX-commit-message.patch. Un exemple: 0001-fix-ViewProjMatrix-getProjectionMatrix.patch

Although Git allows you to merge different branches of code with (in your computer) or a pull request (remote repository), there are times when it may be desirable to create a traditional "patch", which can be sent as an attachment through email. The following workflow explains how to do this.


 * You should be developing your new code in a secondary branch of your repository, and not in the master branch. So the first step is to make sure you are in the correct branch.


 * Now use against the master branch, and use the  option to redirect the result to standard output; then redirect the standard output to a file, which for convenience is created above the source code directory.


 * Another method is

The number of circumflex carets or the number  indicate the number of commits that should be considered, that is,  or  will create three patches for three commits.

This will create a patch or series of patches with the following naming convention

where is a number from  to, and the commit message forms the majority of the file name, for example,

Application de correctifs via git
Git a la capacité de fusionner des correctifs/diffs. Pour en savoir plus à ce sujet, lisez la référence suivante: https://www.drupal.org/node/1399218 git appliquer [nom du correctif] .patch

Git can merge patches or diffs. To know more about this process read Applying patches with Git.

If you already have the patch file in your system, just apply it.

You can use to download a patch from a website, and then apply it through.


 * Conseil utile: ajoutez simplement .diff ou .patch à la fin de l'URL d'une page de validation GitHub, d'une demande d'extraction ou d'une vue de comparaison et vous obtiendrez une vue de cette page. Exemple:
 * Regular GitHub page: https://github.com/FreeCAD/FreeCAD/commit/c476589652a0f67b544735740e20ff702e8d0621
 * 'Diffed' GitHub page: https://github.com/FreeCAD/FreeCAD/commit/c476589652a0f67b544735740e20ff702e8d0621.diff
 * 'Patched' GitHub page: https://github.com/FreeCAD/FreeCAD/commit/c476589652a0f67b544735740e20ff702e8d0621.patch

You can point to a particular commit patch in the repository, and pipe it directly to  to apply the patch. curl https://github.com/FreeCAD/FreeCAD/commit/c476589652a0f67b544735740e20ff702e8d0621.patch | git apply -

Inverser un patch dans git
Si vous avez suivi les instructions ci-dessus et que vous avez changé d'avis, vous pouvez rapidement l'inverser en utilisant: git apply -R path/file.patch ou une autre façon est d'utiliser: git checkout -f qui supprimera les modifications non validées de la branche

When you apply a patch you modify some files. However, these modifications aren't permanent until you commit the changes. Therefore, if you want to revert a patch use the following instructions.

This will revert the changes applied, if you still have access to the original patch file.

Alternatively, this will remove non-committed changes to the branch.

Stockage temporaire dans le cache des git commits
Supposons que vous travaillez sur une branche et que vous modifiez la source en dehors du champ de votre branche actuelle. En d'autres termes, il serait préférable d'ajouter certains commits à une autre branche et de les soumettre à la place du fichier actuel. C'est ici que la commande  'git stash'  peut être très utile. La commande git stash peut vous aider à stocker (temporairement mais en toute sécurité) vos modifications locales non validées. git stash Ensuite, lorsque vous souhaitez utiliser ces commits, vous pouvez faire git stash apply ou git stash pop pop supprimera le cache <BR/> Si vous avez plusieurs caches, vous pouvez faire git stash list Pour en savoir plus sur les autres fonctions que vous pouvez utiliser, consultez https://medium.freecodecamp.org/useful-tricks-you-might-not-know-about-git-stash-e8a9490f0a1a

Say that you're working on a branch and you find yourself making some modifications to the source that are out of the scope of your current branch; in other words, those changes would be better in another branch instead of the current one. The command can be used to temporarily store those uncommitted local changes.

If in the future you want to use those commits, you can pop the commits out of the stash, and into your working branch.

Or if you decide that you don't like those saved commits anymore, you may drop the commits from the stash entirely.

You can list multiple stash commits with

To learn more, read Useful tricks you might not know about Git stash.

Check out GitHub requests locally
Checkout GitHub pull requests locally

FreeCAD revision number
In contrast to subversion, which uses a consecutive number for its revisions, Git produces SHA-1 hash values with every commit. A hash value is a long alphanumeric string that looks like this

Quelle est la dernière révision de FreeCAD Dev
Il y a 2 façons de faire cela: git rev-list --count master
 * 1ère méthode: Dans votre répertoire git cloné, tapez:
 * 2ème méthode: parcourez https://github.com/FreeCAD/FreeCAD et lisez le nombre de mises à jour de FreeCAD.

To find the latest revision number of a particular branch use the operation with the  option. Give the name of the branch, remote repository, tag, or a special pointer like, to indicate the last commit in that particular object.

Or browse the repository on GitHub, and read the amount of commits reported in the particular branch.

Quel est le numéro de révision d'un commit et inversement?
git rev-list --count 9948ee4 13541

Since the hash is an alphanumeric string it is not very useful to decide if a certain commit is older or newer than another hash. To find the revision number of a particular hash, again use the operation; the input can be the full hash, or a partial hash that is unique, usually the first 7 digits are enough.

Revision hash of a specific commit number
If we have the commit number, say, 15000, and we want to find the corresponding hash, we need to calculate the number of commits since this point until the last commit. First, get the latest commit number.

Then subtract the commit that we want.

Then use the operation to show all commits and hashes. The option jumps the difference in commits that we calculated so that we go directly to the hash that we are looking for.

Since the log may show you two close commits, confirm it's the right commit number. If it's off by one, just pick the next commit in the sequence (before or after) and check again.


 * quelques sujets du forum à ce sujet:
 * https://forum.freecadweb.org/viewtopic.php?f=10&t=26673
 * https://forum.freecadweb.org/viewtopic.php?t=5308
 * https://forum.freecadweb.org/viewtopic.php?f=18&t=12883&p=103207#p103203
 * https://forum.freecadweb.org/viewtopic.php?f=10&t=31118

Comment le numéro de révision dans l'aide de FreeCAD est-il généré?

 * https://forum.freecadweb.org/viewtopic.php?f=4&t=3025

The version number that appears in is defined in, which is created at compile time when the  tool is run. Read Extract version number from git source for more information.

See the compile on Unix page for the full information on compiling FreeCAD.

Dépôts alternatifs
La force de Git est que tout à chacun peut cloner un projet, et commencer à modifier du code. Plusieurs contributeurs fréquents du projet FreeCAD ont leur propre dépôt Git, avec lequel ils réalisent leur travail avant que des modifications soient prêtes pour être incluses dans le code source officiel, ou avec lequel ils expérimentent simplement de nouvelles idées. Dans certains cas, vous pouvez souhaiter cloner votre code FreeCAD depuis un des ces dépôt plutôt que depuis les dépôts officiels, pour pouvoir bénéficier des changements réalisés par leur utilisateurs.

Several collaborators of the FreeCAD project have their own Git repositories where they build up their work or where they experiment new ideas before they are ready to be included in the official source code. In certain cases you might want to clone your FreeCAD sources from these other repositories to test their code.

Il est également possible de lier plusieurs dépôts distants avec un seul code local, en utilisant la commande "git remote". C'est pratique pour rester synchronisé avec la branche "master", mais gardez un œil sur le travail des différents dévelopers.

Head to the development section of the FreeCAD forum to discuss more about development of new features. See also Compiling for instructions on compiling FreeCAD.

Lecture complémentaire

 * Git for the lazy
 * The entire Pro Git book