Repository navigation
Expand file tree
/
Copy pathgit.html
More file actions
213 lines (197 loc) · 14.4 KB
/
Copy pathgit.html
File metadata and controls
213 lines (197 loc) · 14.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Git support </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Git support ">
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" href="../styles/docfx.vendor.min.css">
<link rel="stylesheet" href="../styles/docfx.css">
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">
<meta property="docfx:rel" content="../">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../logo.svg" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div class="container body-content">
<div id="search-results">
<div class="search-list">Search Results for <span></span></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination" data-first=First data-prev=Previous data-next=Next data-last=Last></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search main-content">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="">
<h1 id="git-support">Git support</h1>
<p>To gain the full benefits of this module template it is recommended to set it up as a git repository and to push it to <a href="https://github.com">Github</a>.</p>
<div class="NOTE">
<h5>Note</h5>
<p>Git and Github are 2 different things. Git is a version control system that works locally and supports having remotes. Github is one of these possible remotes.</p>
</div>
<h2 id="create-a-git-repository">Create a git repository</h2>
<h2 id="push-and-create-new-repository">Push and create new repository</h2>
<div class="TIP">
<h5>Tip</h5>
<p>You can do the next steps using any git client (even the command line), however in this tutorial we'll be using <a href="https://visualstudio.github.com/">Github Extensions for VisualStudio</a>. If you did not select this option when you installed VisualStudio you can download this extension at the link above.
Create you repository by heading to View > Git Changes, the Git Changes side bar menu will appear and you can press on <code>Push</code> to have your repository created.</p>
</div>
<p><img src="../images/Push-Selection.png" alt="Push Selection"></p>
<div class="NOTE">
<h5>Note</h5>
<p>You may be asked to login if it's the first time you are using Github integration in Visual Studio. If you are asked to login, it is recommended to create a <a href="https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token">Personal Access Token</a> instead of using your login/password. Also the Github automations support both private and public repositories.
<img src="../images/initial-commit.gif" alt="Initial Commit"></p>
</div>
<h2 id="first-ci-build">First CI Build</h2>
<p>In a few minutes you should see that github actinos has run your first build automatically.
This first build will fail because the repository is new and actions don't yet have permissions to write to the repository.
In your repository settings, go to 'Actions' then 'Workflows' and enable "Read/Write" access.</p>
<h2 id="automated-releases">Automated releases</h2>
<p>When you feel you are ready for a beta release, you can create a release branch.
The branch name should include the version number you want, such as <code>release/0.1.0</code>.
A few minutes later if you navigate to your repository on Github, you will notice there is a draft release for v0.1.0.
It has auto-generated release notes wrote from the title of all the PRs that went into a milestone of the save version.
It also has the fully packaged module ready for install from testers.
Each additional push or merge into that release branch will produce a new beta release for you automatically.
When you are ready for production, you can simply merge that release branch into <code>main</code> or <code>master</code> and it will produce a final release for you (non-beta).
If you had any last minute fixes on the release branch that don't exist in <code>develop</code> don't forget to merge that branch into <code>develop</code> too.</p>
<h2 id="automatic-versioning">Automatic Versioning</h2>
<p>The template uses <a href="https://github.com/GitTools/GitVersion">GitVersion</a> and the <a href="https://gitversion.net/docs/git-branching-strategies/gitflow">GitFlow</a> branching strategy in order to manage versions and releases.</p>
<p>This means:</p>
<ul>
<li>The <strong>main</strong> or <strong>master</strong> branch contains the code from the latest published production release. Only merge commits comming from a <code>release</code> or <code>hotfix</code> branch should be merged to it. Each push to this branch will produce a draft release.</li>
<li>The <strong>develop</strong> branch contains the latest development code (alpha). Merging or pushing to this branch does not produce any release but you can get the (alpha) build from the branch build status badge. Also any pull request to it builds the project and you also have the PR build artifact available in the action status.</li>
<li><strong>release</strong> branches are used to prepare the next release, when a <code>release/1.0.0</code> branch is created, a few minutes after, you will have an unpublished release called <code>v1.0.0-beta-1</code>. For each further merge or push to the <code>release/1.0.0</code> branch, you will get the same version but a new beta sequential member like <code>v1.0.0-beta-2</code>. When the release is ready for production, you can merge the <code>release/1.0.0</code> into the <code>main</code> or <code>master</code> branch (usually through a pull request) and it will produce a draft release called v1.0.0 (no longer beta).</li>
</ul>
<div class="TIP">
<h5>Tip</h5>
<p>By default when you initially pushed the first commit to github earlier, it created only the <code>main</code> or <code>master</code> branch. You should on github create a <code>develop</code> branch from it and then pull that branch before any further development.</p>
</div>
<h2 id="automatic-release-notes">Automatic Release Notes</h2>
<p>Release notes for each of those versions are automatically generated from Pull Request (PR) titles for which the milestone matches the released version. The notes are also grouped by label.</p>
<h2 id="mergeable">Mergeable</h2>
<p><a href="https://mergeable.readthedocs.io/en/latest/index.html">Mergeable</a> is a Github extension that enforces some rules over pull requests and/or issues. It is pre-configured in this template to enforce that every pull request has a title, description, label and milestone.</p>
<h2 id="dependabot">Dependabot</h2>
<p><a href="https://dependabot.com/">Dependabot</a> is also pre-setup, it will look at the project dependencies and create automated pull requests when it detects a new version of those dependencies.</p>
<div class="TIP">
<h5>Tip</h5>
<p>Although Dependabot is very useful in warning you about new versions of dependencies and automatically running a built, you should inspect each of those PRs to make sure you do want to accept them. For instance, this template uses Entity Framework and this dll is distributed with the module package. However it's version needs to be declared in the dnn manifest and dependabot is not aware of this. Also, Dnn has some dependencies like Newtonsoft.Json and if you used a different version than Dnn, you may run into some issues which will be hard to catch by unit tests.</p>
</div>
<h2 id="trying-it-out">Trying it out</h2>
<ol>
<li>Let's make sure we have a develop branch on github and we pull it locally. To do this, we will create the develop branch on github and set it as our default branch. At the same time while we are there, we can setup some branch protection rules to prevent merging PRs that don't build or fail tests, etc. Then we will locally fetch and then pull that branch.
<img src="../images/create-develop-branch.gif" alt="Create develop branch"></li>
<li>Now let's create a new local branch to make a small change that we will then submit as a pull request for. We will push that branch and create a pull request for it on github. Creating a pull request will fire up a build and fire up a set of tests too to validate the change does not break anything. When the build suceeds, we will merge that pull request.
<img src="../images/create-pull-request.gif" alt="Create a PR"></li>
<li>Now we will create a 1.0.0-beta release simply by creating a release/1.0.0 branch (it will take a few minutes to create the release). Note that this time because we had a PR with a milestone, we get automatic release notes generated for us.
<img src="../images/create-beta-release.gif" alt="Create a beta RC"></li>
<li>Now let's assume this beta got properly tested and we want to produce the final the final 1.0.0 release, we simply need to merge the <code>release/1.0.0</code> branch into our <code>main</code> or <code>master</code> branch, we will do so using a pull request and we'll do a <code>merge commit</code>.
<img src="../images/create-release.gif" alt="Create Release"></li>
</ol>
<h2 id="documentation">Documentation</h2>
<p>This template has both support for writing your own documentation and also automating documentation from code comments automatically to keep documentation in always in sync with the code.</p>
<p>Github allows having a free documentation website as part of every repository. You may not have realized it yet but it's already done as part of our initial commit.</p>
<p>We simply have to return to github repository settings and set the source for that site. The code can be a folder on any branch or a special branch. Here we will select the docs folder on the branch of our choice.</p>
<div class="TIP">
<h5>Tip</h5>
<p>Selecting the <code>main</code> or <code>master</code> branch will mean that your published documentation will always be in sync with the latest published official release (non-beta). If you want your documentation to be in sync with the latest changes, you can select the <code>develop</code> branch or if you have long standing betas and you want the documentation to reflect it, you can select a <code>release/x.x.x</code> branch.</p>
</div>
<div class="WARNING">
<h5>Warning</h5>
<p>Do not select a theme in the settings, this is for Jekyll sites which we are not using. Also, it may take Github a few minutes to publish your site.
<img src="../images/setup-git-docs.gif" alt="Setup Github Docs"></p>
</div>
<p>What you are seeing in Visual Studio now is only some snippets to get you started until the full documentation is published, now that this is done, you can view the full documentation at <a href="https://DNNCommunity.github.io/DNN.UserVoice/articles/git.html#documentation">https://DNNCommunity.github.io/DNN.UserVoice</a></p>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
<li>
<a href="https://github.com/DNNCommunity/DNN.UserVoice/blob/develop/docfx_project/articles/git.md/#L1" class="contribution-link">Edit this page</a>
</li>
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<h5>In this article</h5>
<div></div>
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
<div class="toggle-mode pull-right">
<div class="icon">
<i aria-hidden="true">☀</i>
</div>
<label class="switch">
<input type="checkbox" id="switch-style">
<span class="slider round"></span>
</label>
<div class="icon">
<i aria-hidden="true">☾</i>
</div>
<script type="text/javascript" src="../styles/toggle-theme.js"></script>
</div>
<span>Generated by <strong>DocFX</strong></span>
</div>
</div>
</footer> </div>
<script type="text/javascript" src="../styles/docfx.vendor.min.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/mermaid.min.js"></script>
<script type="text/javascript" src="../styles/main.js"></script> </body>
</html>