Skip to Content

Is it possible to migrate a repo from Git to another SCP Global account, by holding the history?

Hi guys,

I have SAPUI5 apps in the Git Service provided by SAP Cloud Platform in Global Account A and want to migrate the repository to the Git Service of another Global Account B. Addionallty I want to keep the history created in the first Git (commits, timestemps, etc.).

I am using the same User in both accounts.

I couldn't find a way until now, would be nice, if someone could help me.

Kind Regards,

Manuel

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Aug 20, 2018 at 07:15 PM

    So here we go with full details:

    C:\Users\gwolf\Documents>git clone https://git.hana.ondemand.com/<SubaccountA>/gittest
    Cloning into 'gittest'...
    remote: Counting objects: 12, done
    remote: Finding sources: 100% (12/12)
    remote: Total 12 (delta 0), reused 10 (delta 0)
    Unpacking objects: 100% (12/12), done.
    
    C:\Users\gwolf\Documents>cd gittest
    C:\Users\gwolf\Documents\gittest>git remote add test https://git.hana.ondemand.com/<SubaccountB>/gittest
    
    C:\Users\gwolf\Documents\gittest>git remote
    origin
    test
    
    C:\Users\gwolf\Documents\gittest>git fetch test
    warning: no common commits
    remote: Counting objects: 2, done
    remote: Finding sources: 100% (2/2)
    remote: Total 2 (delta 0), reused 0 (delta 0)
    Unpacking objects: 100% (2/2), done.
    From https://git.hana.ondemand.com/<SubaccountB>/gittest
     * [new branch]      master     -> test/master
    
    C:\Users\gwolf\Documents\gittest>git merge --allow-unrelated-histories test/master
    
    C:\Users\gwolf\Documents\gittest>git push test
    Enumerating objects: 13, done.
    Counting objects: 100% (13/13), done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (8/8), done.
    Writing objects: 100% (12/12), 1.22 KiB | 250.00 KiB/s, done.
    Total 12 (delta 0), reused 0 (delta 0)
    remote: Processing changes: refs: 1, done
    To https://git.hana.ondemand.com/<SubaccountB>/gittest
       470c9c7..914719c  master -> master
    

    This results in the complete history being available in the SubaccountB:


    git-history.png (26.0 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 15, 2018 at 05:24 PM

    Yes, that is possible. You clone the repository from sub-account A to your local system, add the repository from sub-account B as a remote and push it there. I would suggest to have a look at the great OpenSAP Course: SAP Cloud Platform Version Control with Git.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.