Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
kiran_israni3
Participant
14,079
Prerequisite: Have a Hana Trial Account.

Scenario : Create a Project and put it in git repository.

  1. Create your application, if not. For instance, I am creating SAPUI5 Application from "Project From Template".

  2. Below is my project structure.










  3. 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>


  4. Deploy the project to hana cloud platform.










  5. Click on Open the application's page in the SAP HANA Cloud Platform Cockpit.





  6. A window will open as shown below. Click on Versioning, and you will get GIT Repository URL.















  7. Go to your project in SAP WEB IDE, and Right click , Select Git, then "Initialize Local Repository".










  8. In top right corner you will get option of "Set Remote".










  9. Click on Set Remote and paste the GIT Repository URL that we got in step 6. Click on OK.










  10. Click On GIT PANE in from right tab bar, and now your screen will look like below.










  11. Click on Fetch.










  12. Click on Stage All, write Commit Description, and click on Commit.










  13. 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". 










  14. Now go to HANA cockpit, click on Refresh, and we will get our latest commit.










  15. Click on Actions, to create a new version based on latest commit, and give the version number.










  16. Click on Actions again, and this time to activate the current version.





  17. After activating, screen will look like below.










  18. 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.

  19. 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>











  20. 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
9 Comments
Labels in this area