Changes between Initial Version and Version 1 of HowToGit


Ignore:
Timestamp:
May 18, 2019, 3:39:18 AM (5 years ago)
Author:
neteler
Comment:

New - draft

Legend:

Unmodified
Added
Removed
Modified
  • HowToGit

    v1 v1  
     1== Contributing guidelines ==
     2
     3The development workflow changes notably after [https://trac.osgeo.org/grass/wiki/GitMigration#ImplementationofmigrationfromOSGeoSVNandtractoGitHub migration from Subversion to git] (!GitHub).
     4
     5Important changes:
     6 * committing to "master" (former "trunk") is a no-go and disabled
     7 * hence: you will open a pull request for a change, even being a core developer
     8   * Rationale: pull requests are the perfect platform to discuss/improve changes before merging.
     9
     10If you are a core developer:
     11 * the core devs don't go though forks, but create feature branch(es) for changes
     12
     13If you are an "external" contributor:
     14 * you may fork the GRASS GIS repository and suggest your changes as pull requests.
     15
     16=== Workflow for core developers ===
     17
     18Here no fork needed but create feature branch(es) on master.
     19
     20{{{
     21# <make local source code changes>
     22vim ...
     23
     24# fetch all branches from all remotes
     25git fetch --all
     26
     27# list existing branches:
     28git branch -a
     29
     30# create new local branch (pick a new name for feature_branch_name)
     31git checkout -b $feature_branch_name
     32
     33# list local changes
     34git status
     35git add file1.c file2.py ...
     36git commit -m 'my change with reasonable explanation...'
     37
     38# push feature branch to origin, i.e. original GRASS GIS repo master
     39git push origin $feature_branch_name
     40# create pull request in GitHub Web interface (the link is shown in
     41the terminal)
     42
     43# during PR review phase, make more local changes if needed
     44git add .
     45git commit -m 'my second change'
     46git push origin $feature_branch_name
     47# ..... will be added to existing pull request
     48}}}
     49
     50NOTE: for different pull requests, simply create different feature branches.
     51
     52=== Workflow for external contributors - option 1 ===
     53
     54- to be discussed -
     55
     56First fork the GRASS GIS repo in the !GitHub web interface.
     57
     58{{{
     59# create fork via GitHub Web interface
     60
     61# checkout your fork
     62git clone $my_for_url
     63
     64# all steps see above, core dev section
     65...
     66
     67# push feature branch to own fork repo of GRASS GIS
     68git push origin $feature_branch_name   # here: origin is fork repo
     69
     70# create pull request in GitHub Web interface (the link is shown conveniently in the terminal)
     71}}}
     72
     73
     74=== Workflow for external contributors - option 2 ===
     75
     76- to be discussed -
     77
     78You clone the GRASS GIS repo and add the fork as an additional remote, this makes merging changes from the GRASS GIS repo easier.
     79
     80{{{
     81git clone https://github.com/OSGeo/grass.git
     82cd grass
     83git remote add github https://github.com/<username>/grass.git
     84git remote set-url --push github
     85ssh://git@github.com/<username>/grass.git
     86...
     87git push github <feature-branch>
     88}}}
     89
     90This way origin is the authoritative source for the code, and additional remotes are forks.
     91
     92== Review of pull requests ==
     93
     94In the review phase, PRs can be commented and modified.
     95
     96TODO add more
     97
     98== Merging of pull requests ==
     99
     100The CI should run successfully for every commit (chunk of commits in PR to be exact) before it goes into master.
     101
     102== Backporting to release branches ==
     103
     104TODO
     105
     106== Further reading ==
     107
     108 * Git Cheatsheet: http://ndpsoftware.com/git-cheatsheet.html#loc=workspace;