Manual Synchronization of External Git Repository Changes
If some changes committed in an external repository don't get updated in Codebeamer, due to technical problems, the changes can be synchronized manually.
For example, of the four changes committed remotely in the repository, two changes were successful, however the two others are missing. Git log shows all the four changes:
commit dcbfe97a4b8577dd0f7cc4ef676f1245564d2d96
Author: bond <bond@mail.server>
Date: Tue Oct 31 11:42:04 2017 +0100
#27098 successful2
commit 45b18dbdf6a954301244647ea8665fd728d26200
Author: bond <bond@mail.server>
Date: Tue Oct 31 11:39:17 2017 +0100
#27098 missing2
commit 43983ddedabcc40e943a7ec2e79b228cd69102fa
Author: bond <bond@mail.server>
Date: Tue Oct 31 11:35:52 2017 +0100
#27098 missing1
commit 19fde45633ced7db2a3d88cd7b683e9f763f0686
Author: bond <bond@mail.server>
Date: Tue Oct 31 11:30:29 2017 +0100
#27098 successful1
On the other hand, Codebeamer shows only two of the four changes in the repository view and also at the item:
To correct this, perform the following tasks on the server hosting the remote repository:
1. Create a text file based on git log changes (e.g. missingchanges.txt). Place each change that needs to be synchronized into a new line:
<old_hash_1> <new_hash_1> <target_1>
<old_hash_2> <new_hash_2> <target_2>
.
.
<old_hash_n> <new_hash_n+1> <target_n+1>
For example:
19fde45633ced7db2a3d88cd7b683e9f763f0686 43983ddedabcc40e943a7ec2e79b228cd69102fa refs/heads/master
43983ddedabcc40e943a7ec2e79b228cd69102fa 45b18dbdf6a954301244647ea8665fd728d26200 refs/heads/master
2. Call git post receive hook for each change by executing the command (where <file_name> is the previously created text file, and <path> is the path to the repository folder):
cat <file_name>|<path>/hooks/post-receive
For example, running the command from the repository folder:
cat missingchanges.txt|./hooks/post-receive
Once the above steps are done, the missing changes should appear in Codebeamer: