Updating Tudat¶
During the installation as discussed in Download using SmartGit (Developer) the TudatBundle is cloned to your local system. However, this does not include the latest version of the code. This page explains how your code is updated to the newest version and how different branches of the Tudat project can be used. This tutorial assumes that you’ve completed the Download using SmartGit (Developer) tutorial.
Synchronizing repositories¶
Step 1: Fork Tudat Bundle and Tudat repository (Do this once!)¶
- Fork Tudat Bundle
- Create your own copy of the Tudat Bundle under your GitHub account. Go to https://github.com/Tudat/tudatBundle and click on
Fork
. - Fork Tudat
- Go to https://github.com/Tudat/tudat and click on
Fork
.
Step 2: Synchronize with official Tudat Bundle¶
- Rename official Tudat Bundle (Do this once!)
- In Smartgit right-click on origin choose
Rename
and call it “upstream”. - Add forked Tudat Bundle as origin (Do this once!)
- Double click on your tudatBundle repository in the
Repositories
tree on the left and chooseRemote/Add...
. For the URL select https://github.com/userName/tudatBundle.git and call it “origin”, clickAdd
. Right-click origin in theBranches
tree on the left and selectPull
. A pop-up window occurs, chooseFetch Only
. - Update to the latest Tudat Bundle (Do this every time!)
- Right-click on
upstream
and selectPull
. If a dialog pops up asking you to Rebase or Merge, selectRebase
and clickConfigure
. ChooseFetch only
. Right-click on themaster
branch under theupstream
entry and selectMerge
. You will be asked how to incorporate any changes. In almost all casesFast forward
is the best option. In case there are conflicts you should do a merge. You have now succesfully updated your local Tudat Bundle to the latest version. However, you need to synchronize this change to your remote version as well. - Synchronize with your remote (Do this every time!)
- Right-click on
Local Branches/master
choosePush to...
select target repository: origin (https://github.com/userName/tudatBundle.git) choosePush
.
Step 3: Synchronize with official Tudat¶
- Set-up official Tudat (Do this once!)
- In the
Repository
window selecttudat
undertudatBundle
and right-click theorigin
entry in theBranches
window and selectProperties
. Change the official remote Tudat repository url to your forked repository url: https://github/username/tudat.git. Now, all that remains is to re-add the official remote Tudat repository url. First, make sure thattudat
is still selected in theRepositories
window. Then, clickRemote Add
from the top menu. Like before fill in the official address for the remote url:https://github.com/Tudat/tudat.git
. Again choose “upstream” as the name. - Update to the latest Tudat (Do this every time!)
- Right-click on
upstream
and selectPull
. ChooseFetch only
. Right-click on themaster
branch under theupstream
entry and selectMerge
. You will be asked how to incorporate any changes. In almost all casesFast forward
is the best option. In case there are conflicts you should do a merge. You have now succesfully updated your local Tudat to the latest version. However, you need to synchronize this change to your remote version as well. It could be that you have to checkout the localmaster
branch first if an error message pops up. Double click the local branches,master
branch. TrySync
again.
Switching branches¶
Repositories can have multiple branches. These branches are used to develop new applications or versions of the project while keeping a clear and working version of the code available in the master branch. Once the new application is verified it can be merged into the master branch for a new working version of the project. Switching between branches is simple in Smartgit:
Select a branch, for example the development
branch of Tudat, select Check Out...
. Smartgit will ask you whether you want to create a local branch, if you intend to work on this branch and change code, create a local branch and choose Checkout
. If you only want to view the code inside this branch select the other option and Checkout
.
If you have created a local branch one can easily switch between the local branches by double-clicking on the branch and selecting Checkout
.
Warning
Make sure to commit any changes you made in your branch before switching to a different branch. If not, you will lose all changes you’ve made up to the latest commit. Smartgit will likely warn you if you have made any changes to the code which have not been committed.