-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Git Workflow
The general process for working with Nancy is:
- Fork on GitHub
- Clone your fork locally
- Create a local branch (
git checkout -b myBranch
) - Work on your feature, spiking/prototyping as required (see below)
- Rebase if required (see below)
- Push the branch up to GitHub (
git push origin myBranch
) - Send a Pull Request on GitHub
You should never work on a clone of master, and you should never send a pull request from master - always from a branch. The reasons for this are detailed below.
It's quite normal, and encouraged, that during design/development of your feature you create several spikes/prototypes, which you share with the other developers (*cough* via the Google Group *cough*) for feedback. Due to the fact that rebasing public commits is pure evil, and that we require you to rebase any updates from upstream/master, it is recommended that you:
-
Create one or more "MyFeatureSpike" branch(es) (or words to that effect) - this makes it quite clear to other developers that this is a temporary spike branch, and if they decide to fork it for their own work they should do so in the knowledge that it will:
a) likely be rebased, and
b) get deleted at some point.
-
When you're happy with the approach, create your real feature branch and start working on that. It is suggested that you effectively "throw away" your spike branch and start afresh with a test-first approach, but as long as you end up with good quality, well tested code this isn't enforced.
While you're working away in your branch it's quite possible that your upstream master (most likely the canonical TheCodeJunkie version) may be updated. If this happens you should:
- Stash any un-committed changes you need to
git checkout master
git pull upstream master
git checkout myBranch
git rebase master myBranch
-
git push origin master
- (optional) this this makes sure your remote master is up to date
This ensures that your history is "clean" i.e. you have one branch off from master followed by your changes in a straight line. Failing to do this ends up with several "messy" merges in your history, which we don't want. This is the reason why you should always work in a branch and you should never be working in, or sending pull requests from, master.
If you're working on a long running feature then you may want to do this quite often, rather than run the risk of potential merge issues further down the line.
While working on your feature you may well create several branches, which is fine, but before you send a pull request you should ensure that you have rebased back to a single "Feature branch" - we care about your commits, and we care about your feature branch; but we don't care about how many or which branches you created while you were working on it :-)
When you're ready to go you should confirm that you are up to date and rebased with upstream/master (see "Handling Updates from Upstream/Master" above), and then:
git push origin myBranch
- Send a descriptive Pull Request on GitHub - making sure you have selected the correct branch in the GitHub UI!
- Wait for TheCodeJunkie to merge your changes in and reformat all of your code because he has StyleCop OCD ;-)
For more information on the merits of this workflow please see RobertTheGrey's excellent post on the Fubu MVC Development Group.
- Introduction
- Exploring the Nancy module
- Routing
- Taking a look at the DynamicDictionary
- Async
- View Engines
- Using Models
- Managing static content
- Authentication
- Lifecycle of a Nancy Application
- Bootstrapper
- Adding a custom FavIcon
- Diagnostics
- Generating a custom error page
- Localization
- SSL Behind Proxy
- Testing your application
- The cryptography helpers
- Validation
- Hosting Nancy with ASP.NET
- Hosting Nancy with WCF
- Hosting Nancy with Azure
- Hosting Nancy with Suave.IO
- Hosting Nancy with OWIN
- Hosting Nancy with Umbraco
- Hosting Nancy with Nginx on Ubuntu
- Hosting Nancy with FastCgi
- Self Hosting Nancy
- Implementing a Host
- Accessing the client certificate when using SSL
- Running Nancy on your Raspberry Pi
- Running Nancy with ASP.NET Core 3.1