on 08-15-2018 6:13 PM
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
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
These solution is quite good, but not woking completly:
It works for a directory, where all commits are belonging to my user.
But if I try it out with a productive repo, where other users have participated, I get the error:
ERROR: In commit x123y committer email address not_my_mail@xy.com does not match your user account.
The following address is currently registered for you: my_mail@yx.com
Afterwards the target repo is still empty.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.