How to setup the development environment
Forking the repository#
- Login to your bitbucket account
- Navigate to N.I.N.A.'s main repository and click on the big plus
- Click "Fork this repository"
- You will see a configuration wizard for your fork.
- Enter a name for your forked repository. (This guide will use "ninaexamplefork" for reference)
- Give a short description what your intention is with this fork (optional)
- Uncheck Issue tracking and Wiki as you don't need this in your fork.
- Click on "Fork repository"
- You will be navigated to your new repository at https://bitbucket.org/\<your_username>/\<your_fork's_name>/
Cloning Repository#
- On the top right of your forked repository click on the "Clone" button
- A pop up will show the command how to clone this repository to your local machine
- Open a command window
- Navigate to the folder where you want your repository folder to be created in
- Enter the command that was shown in step 2.
git clone -n -b develop https://<YourUserName>@bitbucket.org/<YourUserName>/<YourForkName>.git # NOTE: the -n flag for "don't checkout the branch" # Ignore any LFS smudge errors for now. They are not yet synced and will get synced in a later step
- Navigate to the created folder
cd <YourForkName>
- Next you need to add the "upstream" to the root repository (where your fork is based on). This is later required for merging from the main dev branch etc.
git remote add upstream https://bitbucket.org/Isbeorn/nina.git
- Bitbucket will not automatically copy over the LFS into the fork repository. This has to be done manually. Run the following commands to sync the lfs
git lfs fetch upstream --all git lfs push origin --all
- Now we need to checkout the develop branch
git checkout develop
- Fetch the submodules for the external dependencies. These contain all third party vendor DLLs that are not part of any nuget package, e.g. Camera Drivers, VCRedist etc.
git submodule update --init --recursive
Navigation in Visual Studio#
- Navigate to your local clone and open "NINA.sln"
- Visual studio has a built in git UI, which you can find on the lower right called "Team Explorer"
- Inside the Team Explorer you can get a visual list of all available branches
- Here you can see all branches of your forked repository. Note that the upstream we added earlier is not yet displayed.4. Expand "remotes\origin" and double click on "develop" to switch to this branch
- Click the back button (top left) and click on "Sync"
- Click on "Fetch" and select "upstream" to fetch all branches that are inside "upstream", which is the root repository
- Now navigate back and select the "Branches" again. Now the "upstream" branches are also available.
- To fetch and merge the latest code of the root repository you can right click on "develop", click on "fetch" and "Merge from..." afterwards.
- Now your branch is up to date and you can start coding.