Originally posted by GeneralD
View Post
I am new to Git but managed to figure out the process ( another post in one of the early pages helped a lot ).For anyone interested in merging the Gamework builds, knowledge required is basic knowledge of Git commands.
As Nvidia has released all of their Gameworks tech in 4.15, so integration is easier than it would have been when a tech might have required to be ported to a newer version of engine.
For starters
1) Download and install Git
2) Create a folder for the engine in a drive with plenty of space
3) Right click and run Git Bash while in that folder
4) Type and run "git clone https://github.com/NvPhysX/UnrealEngine.git"
Now you need to set-up tracking for all the branches you want ( a branch in this case is a different gameworks tech for a version of unreal ) eg VXGI-4.15 is one branch and VXGI-4.14 is another branch. Type "git branch -a" anytime to get a list of all the remote and local branches.
Create tracking for all the branches you require in your Unreal build.
5) For local tracking of a remote branch "git branch -t VXGI-4.15 origin/VXGI-4.15" ( Here VXGI-4.15 is a name you set for your own tracking purposes whereas origin/VXGI-4.15 is the branch present on Github that contains the VXGI integration , you can always get the name of the remote branches through "git branch -a")
Repeat the above step for all the branches you want to merge.
Now switch to any branch you have created tracking for:
6) "git checkout VXGI-4.15" where "VXGI-4.15" is the same name as you set for tracking purposes above.
(Some people might prefer switching to the "release" branch, but this worked for me)
Next step is to create a new branch from any of the above tracking branches. This branch will be used to merge all the gameworks tech. You can name it eg AllGameworks.
7) "git branch AllGameworks" this will create a new branch named AllGameworks from the last branch you did checkout on. In this case VXGI-4.15.
Before we start the merging process, we need to switch to the AllGameworks branch ( which in this case already contains VXGI as its a copy of it )
8) "git checkout AllGameworks" sets the AllGameworks as the current branch we will start the merging process upon
Now starts the tricky part. When a branch is merged into another various conflicts occur. But fortunately for us, all the gameworks tech are on 4.15 so resolving the conflicts is relatively easier.
Next merge a branch ( eg Hairworks ) into AllGameworks branch
9)"git merge HWorks4.15" where HWorks4.15 is the name of the local tracking set up for origin/HairWorks
On the screen will be shown many conflicts. Each line starting with "CONFLICT" means that a conflict has occurred in the merging process in a specific file. The path and name of the file will be mentioned in the same line. Now the conflict will have to be resolved. At this point donot close Git.
How to resolve a conflict : Open the file mentioned in CONFLICT in Visual Studio. Search for "<<<<<<< HEAD" in the file. This where the conflict starts. Some conflicts might require some code addition or removal but in most cases just delete or comment out "<<<<<<< HEAD" and then search/look "=======" and delete/comment it and then search/look for ">>>>>>> (Gameworks tech name)" and delete/comment it. In one of the ".cs" file conflict file look for a extra "}" in the end, you might need to remove it. Make sure there arent other conflicts present in the same at other locations through a thorough search for "<<<<<<< HEAD". Save the file when its done.
Do the above for all the conflicts.
10) Now add the changes with "git add ." command.
11) Finally commit the changes "git commit -m "random comment""
Now you have merged two branches. Want to add more branches to AllGameworks then goto Step9 and merge another branch.
When its all done, run setup.bat , run generateprojectfiles.bat , open the .sln file in Visual Studio and right click on "UE4" and click "Build". If all the conflicts been resolved then it will compile successfully after some time.
I am no expert but hope there arent any errors in the steps mentioned above.
Personally whenever I merged a tech then a created a new branch from it and switched to it. This way can always go back to a branch that did compile successfully eg VXHW ( VXGI + Hairworks ) , a branch from VXHW called VXHWF ( VXGI + Hairworks + Flow ) , a branch from VXHWFVL ( VXGI + Hairworks + Flow + Volumetric Lighting ).
As Nvidia has released all of their Gameworks tech in 4.15, so integration is easier than it would have been when a tech might have required to be ported to a newer version of engine.
For starters
1) Download and install Git
2) Create a folder for the engine in a drive with plenty of space
3) Right click and run Git Bash while in that folder
4) Type and run "git clone https://github.com/NvPhysX/UnrealEngine.git"
Now you need to set-up tracking for all the branches you want ( a branch in this case is a different gameworks tech for a version of unreal ) eg VXGI-4.15 is one branch and VXGI-4.14 is another branch. Type "git branch -a" anytime to get a list of all the remote and local branches.
Create tracking for all the branches you require in your Unreal build.
5) For local tracking of a remote branch "git branch -t VXGI-4.15 origin/VXGI-4.15" ( Here VXGI-4.15 is a name you set for your own tracking purposes whereas origin/VXGI-4.15 is the branch present on Github that contains the VXGI integration , you can always get the name of the remote branches through "git branch -a")
Repeat the above step for all the branches you want to merge.
Now switch to any branch you have created tracking for:
6) "git checkout VXGI-4.15" where "VXGI-4.15" is the same name as you set for tracking purposes above.
(Some people might prefer switching to the "release" branch, but this worked for me)
Next step is to create a new branch from any of the above tracking branches. This branch will be used to merge all the gameworks tech. You can name it eg AllGameworks.
7) "git branch AllGameworks" this will create a new branch named AllGameworks from the last branch you did checkout on. In this case VXGI-4.15.
Before we start the merging process, we need to switch to the AllGameworks branch ( which in this case already contains VXGI as its a copy of it )
8) "git checkout AllGameworks" sets the AllGameworks as the current branch we will start the merging process upon
Now starts the tricky part. When a branch is merged into another various conflicts occur. But fortunately for us, all the gameworks tech are on 4.15 so resolving the conflicts is relatively easier.
Next merge a branch ( eg Hairworks ) into AllGameworks branch
9)"git merge HWorks4.15" where HWorks4.15 is the name of the local tracking set up for origin/HairWorks
On the screen will be shown many conflicts. Each line starting with "CONFLICT" means that a conflict has occurred in the merging process in a specific file. The path and name of the file will be mentioned in the same line. Now the conflict will have to be resolved. At this point donot close Git.
How to resolve a conflict : Open the file mentioned in CONFLICT in Visual Studio. Search for "<<<<<<< HEAD" in the file. This where the conflict starts. Some conflicts might require some code addition or removal but in most cases just delete or comment out "<<<<<<< HEAD" and then search/look "=======" and delete/comment it and then search/look for ">>>>>>> (Gameworks tech name)" and delete/comment it. In one of the ".cs" file conflict file look for a extra "}" in the end, you might need to remove it. Make sure there arent other conflicts present in the same at other locations through a thorough search for "<<<<<<< HEAD". Save the file when its done.
Do the above for all the conflicts.
10) Now add the changes with "git add ." command.
11) Finally commit the changes "git commit -m "random comment""
Now you have merged two branches. Want to add more branches to AllGameworks then goto Step9 and merge another branch.
When its all done, run setup.bat , run generateprojectfiles.bat , open the .sln file in Visual Studio and right click on "UE4" and click "Build". If all the conflicts been resolved then it will compile successfully after some time.
I am no expert but hope there arent any errors in the steps mentioned above.
Personally whenever I merged a tech then a created a new branch from it and switched to it. This way can always go back to a branch that did compile successfully eg VXHW ( VXGI + Hairworks ) , a branch from VXHW called VXHWF ( VXGI + Hairworks + Flow ) , a branch from VXHWFVL ( VXGI + Hairworks + Flow + Volumetric Lighting ).
Comment