Prerequisite: Have a Hana Trial Account.
Scenario : Create a Project and put it in git repository.
- Create your application, if not. For instance, I am creating SAPUI5 Application from "Project From Template".
- Below is my project structure.
- Let's say, I have following code in view.
<mvc:View xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
controllerName="com.git.basicGitBasic.controller.GitView" displayBlock="true">
<App>
<pages>
<Page title="{i18n>title}">
<Label text="Welcome to Git" width="100%" id="idWelcome" design="Bold"/>
</Page>
</pages>
</App>
</mvc:View>
- Deploy the project to hana cloud platform.
- Click on Open the application's page in the SAP HANA Cloud Platform Cockpit.
- A window will open as shown below. Click on Versioning, and you will get GIT Repository URL.
- Go to your project in SAP WEB IDE, and Right click , Select Git, then "Initialize Local Repository".
- In top right corner you will get option of "Set Remote".
- Click on Set Remote and paste the GIT Repository URL that we got in step 6. Click on OK.
- Click On GIT PANE in from right tab bar, and now your screen will look like below.
- Click on Fetch.
- Click on Stage All, write Commit Description, and click on Commit.
- Now click on Rebase , select the remote branche origin/master, and click on OK button. Now click on Push Button, and select origin/master. After 5seconds, in the top right corner, you will get "Push has been completed".
Recently, I got few comments: Rebase is throwing error at this point in latest versions. Hence, modifying this point:
Click on Commit and Push Button, and select origin/master. After 5seconds, in the top right corner, you will get "Push has been completed".
- Now go to HANA cockpit, click on Refresh, and we will get our latest commit.
- Click on Actions, to create a new version based on latest commit, and give the version number.
- Click on Actions again, and this time to activate the current version.
- After activating, screen will look like below.
- For another developer, to get the application in the workspace, click on File, Git, then Clone Repository. Since I am the same developer, and I already have application in my workspace, I won't perform Step 18.
- Important : Before starting to make any changes, make sure, first FETCH the code, then Rebase (to get back any new commits from remote branch, so that we are in sync), make changes in the code, STAGE ALL your changes, write Commit Description, then commit, then push.
<mvc:View xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
controllerName="com.git.basicGitBasic.controller.GitView" displayBlock="true">
<App>
<pages>
<Page title="{i18n>title}">
<Label text="Git modifications" width="100%" id="idWelcome" design="Bold"/>
<Button text="Modified"/>
</Page>
</pages>
</App>
</mvc:View>
- Go to Hana Cockpit, Refresh, provide the new version and activate the application.
That's all for now.
Please feel free to provide your queries/doubts/suggestions/corrections.
Thanks
Kiran Israni