Branches cross updating. Change default branch. Initial git setup

  1. On GitHub forked ‘EpicGames’ ‘UnrealEngine’.
  2. Created new branch from ‘promoted’ called it ‘MMpromoted’.
  3. Made ‘MMpromoted’ default branch.
  4. Cloned MMpromoted to local.
  5. Ran ‘Setup.bat’.
  6. Ran ‘GenerateProjectFiles.bat’.
  7. Ran ‘UE4.sln’ in Visual Studio 2013 Ultimate. With Development editor and Win64 options.
  8. Built ‘UE4’
  9. Pushed ‘MMpromoted’ branch to origin.
  10. Ran binary ‘UE4Editor.exe’.

Here is where it went bad.

Read best practice to keep in sync is to ‘fetch’ (not pull) from upstream to local branch and then ‘merge’ from that local branch to my local branch then ‘push’ to ‘origin’. So from ‘upstream/promoted’ to ‘promoted’ then merge with ‘MMpromoted’ and then push to GitHub. So I needed to get a local copy of ‘promoted’ to work on and did in Terminal:

git checkout -b promoted origin/promoted

And got the following error in Terminal (below).
And now I can’t checkout ‘MMpromoted’ again in SourceTree and get an error which is posted after the first error.

  1. The ‘promoted’ branch shows changes (unstaged files to be committed) but how can that be since I only cloned, committed, and pushed to the ‘MMpromoted’ branch?

  2. Was it unwise to change the default branch from ‘release’? If so if I change it back now will there be issues like things that need to be merged which I have no idea what to do with.

  3. So how do I go from here? If I commit the unstaged files then that branch is no longer pristine replica of the upstream EpicGames.

Terminal Error:

ANVIL ~/Perforce/Anvil/MM/Master/MMengine (MMpromoted)

$ git branch -a

MMpromoted

remotes/origin/4.0

remotes/origin/4.1

remotes/origin/4.2

remotes/origin/4.3

remotes/origin/4.4

remotes/origin/4.5

remotes/origin/4.6

remotes/origin/4.7

remotes/origin/4.8

remotes/origin/4.9

remotes/origin/HEAD → origin/MMpromoted

remotes/origin/MMpromoted

remotes/origin/master

remotes/origin/promoted

remotes/origin/release

remotes/upstream/4.0

remotes/upstream/4.1

remotes/upstream/4.2

remotes/upstream/4.3

remotes/upstream/4.4

remotes/upstream/4.5

remotes/upstream/4.6

remotes/upstream/4.7

remotes/upstream/4.8

remotes/upstream/4.9

remotes/upstream/master

remotes/upstream/promoted

remotes/upstream/release

ANVIL ~/Perforce/Anvil/MM/Master/MMengine (MMpromoted)

$ git checkout -b promoted origin/promoted

Branch promoted set up to track remote branch promoted from origin.

Switched to a new branch ‘promoted’

Checking dependencies (excluding Mac, Android, Linux)…

The following file(s) have been modified:

Engine/Binaries/DotNET/DotNETUtilities.dll

Engine/Binaries/DotNET/EnvVarsToXML.exe

Engine/Binaries/DotNET/UnrealBuildTool.exe

Engine/Binaries/DotNET/UnrealBuildTool.exe.config

Engine/Binaries/Win64/UnrealHeaderTool.exe

Engine/Binaries/Win64/UnrealHeaderTool-Core.dll

Engine/Binaries/Win64/UnrealHeaderTool-CoreUObject.dll

Engine/Binaries/Win64/UnrealHeaderTool-Json.dll

Engine/Binaries/Win64/UnrealHeaderTool-Projects.dll

Engine/Build/Build.version

Engine/Plugins/ScriptGeneratorPlugin/Binaries/Win64/UnrealHeaderTool-ScriptGeneratorPlugin.dll

Re-run with the --force parameter to overwrite them.

Updating dependencies: 100% (76/76), 17.1 MiB cached, done.

ANVIL ~/Perforce/Anvil/MM/Master/MMengine (promoted)

$

SourceTree error:

git -c diff.mnemonicprefix=false -c core.quotepath=false checkout MMpromoted

error: The following untracked working tree files would be overwritten by checkout:

Engine/Source/ThirdParty/FreeType2/FreeType2-2.4.12/src/freetype-2.4.12.tar.gz  

Engine/Source/ThirdParty/FreeType2/FreeType2-2.6/Src/freetype-2.6.tar.gz  

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/_bsddb.pyd  

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/_ctypes.pyd  



Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/_ctypes_test.pyd  

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/_elementtree.pyd  

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/_hashlib.pyd  

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/_msi.pyd  

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/_multiprocessing.pyd  



Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/_socket.pyd  

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/_sqlite3.pyd  



Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/_ssl.pyd  

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/_testcapi.pyd  



Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/_tkinter.pyd  

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/bz2.pyd  

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/pyexpat.pyd  



Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/select.pyd  

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/unicodedata.pyd  

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/DLLs/winsound.pyd  



Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pythonwin/dde.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pythonwin/win32ui.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pythonwin/win32uiole.pyd

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/simplejson/_speedups.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sip.pyd

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/_win32sysloader.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/_winxptheme.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/mmapfile.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/odbc.pyd

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/perfmon.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/servicemanager.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/timer.pyd

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/win2kras.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/win32api.pyd

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/win32clipboard.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/win32console.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/win32cred.pyd

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/win32crypt.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/win32event.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/win32evtlog.pyd

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/win32file.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/win32gui.pyd
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/win32help.pyd

Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-pa

Aborting

Completed with errors, see above.

Hi Skie,

I looked at some of the files in the error message that you mentioned, and these seem to be files that are found in one branch of the Engine (promoted), but not in another branch (master). I do not believe there would be any problems with syncing these.

I tried to reproduce your repo set up, and I get some very similar messages (I am using the Desktop GitHub and Git Shell clients). You should be fine to either commit those changes or overwrite them in your promoted branch, since the next time you sync to the UnrealEngine/promoted branch, it should put you where you want to be. When I committed the changes, I was no longer notified about them by the Desktop GitHub client when I switched branches. However, the Git Shell client still showed discrepancies (though it did indicate that there were no changes to commit).

I also tried using the --force parameter in Git Shell when checking out a different branch, but that did not clear up the messages about modified files there. I can’t say for certain why these messages are appearing, but they seem to be benign.

I see now that such things as building the UE4.sln, running GenerateProjectFiles.bat, change files to ALL local branches. So having a clean copy of the EpicGames branches can only be done by having another completely separate fork and clone and never building it or doing anything with it at all really. I guess there is no point then in having a custom branch based on one of my forked branches. The working process would be just to pick the ‘promoted’ branch and pull from upstream right into it and push to origin.

What about the changing of the default branch on my GitHub fork of UE. Should I change it back now that it is early (after I sync everything of course) as it could cause problems. In other words is it highly recommended not to change it or is it a trivial thing that most developers do with no problems as long as you don’t change it without being clear of any commits and such.

I also can not get rid of the "Re-run with the --force parameter to overwrite them. " message for every pull and push I do. If someone has the same issue please post your solution.

Thanks for the help

Hi Skie,

When it comes to the question of whether you should have a separate branch for the Engine that you are working out of, that isn’t really a bad idea. That way when you want to upgrade your Engine in the future to whichever version was most recently released, you can upgrade the base release branch and test the Engine there to make sure there are no problems before merging the new Engine version into the branch you are working out of.

Just keep in mind that you will most likely want to work out of the Release branch, and not the Promoted branch. The Promoted branch is intended to provide an opportunity to get an early look at bug fixes and new features that are coming, but it has not been extensively tested so it may be prone to errors and/or crashes.

I will see if I can find out any more information about the message about needing to use the --force parameter. I do still see that when I am using the Git Shell client and changing branches, but using the Desktop GitHub client has no problems.