I mean, at the last days of the war the collapsing German government surely couldn't effectively inform all the soldiers to cease fire.
First, some context for the surrender of Germany from the allied point of view, followed by a rather broad account focused upon the perspective of British and Canadian forces in 21st army group and 8th Army. This account and my area of expertise will greatly limit the extent to which I can comment, as there are a large number of human security issues of which I am confident enough in my knowledge to note but lack the necessary expertise to comment upon in any depth. Or in other words, I know a lot about the war, but very little about refugee or migrant rights in 1945-46.
The first of the official German surrender delegation arrived via car at 21st Army Group HQ on 3rd May 1944, having been directed on by General Dempsey (2nd British Army) to discuss terms of surrender for the German Army. They had hoped to drag out negotiations so as to allow for troops, equipment and civilians to escape the Red Army's advance, and surrender to the Western Allies instead. They consequently offered the surrender of Army Group Vistula, and refused all other points. Montgomery, a general and not a politician, was not empowered to negotiate on behalf of the Allied Governments or SHAEF, and insisted upon the terms the Allies Governments had made clear- total, unconditional surrender.
Initially alarmed by this, the German representatives declared they did not have the power to accept these terms, refused and left, only to return the next day once their total powerlessness in the face of the allied armies was made clear. They returned at 1800 hrs. 4th May, and the instrument of surrender for the German Army was signed at 1830 hrs. several days later, on the 7th, Germany formally surrendered to General Eisenhower at SHAEF HQ in Rheims, and Red Army High Command, Berlin. the terms laid out were relatively straightforward:
"1.The German Command agrees to the surrender of all German armed forces in HOLLAND, in northwest GERMANY including the FRISIAN ISLANDS and HELIGOLAND and all other islands. In SCHLESWIG-HOLSTEIN and in DENMARK, to the C-in-C. 21 Army Group. This is to include all naval ships in the areas. These forces to lay down their arms and to surrender unconditionally.
2.All hostilities on land, on sea, or in the air by German forces in the above areas to cease at 0800hrs. British Double Summer Time on Saturday 5 May 1945.
3.The German command to carry out at once, and without argument or comment, all further orders that will be issued by the Allied Powers on any subject.
4.Disobedience of orders, or failure to comply with them, will be regarded as a breach of these surrender terms and will be dealt with by the Allied Powers in accordance with the accepted laws and usages of war.
5.This instrument of surrender is independent of, without prejudice to, and will be superseded by any general instrument of surrender imposed by or on behalf of the Allied Powers and applicable to Germany and the German armed forces as a whole.
6.This instrument of surrender is written in English and in German. [The] English version is the authentic text.
7.The decision of the Allied Powers will be final if any doubt or dispute arises as to the meaning or interpretation of the surrender terms" (Buckley, J., 2014)
Many local units made additional agreements under similar terms, either in northern Italy or other locations. The terms above were originally dated to be announced the 9th of May, which would have allowed preparations for celebrations to be made in the allied countries. however mis-communication and a lapse in reporting security amongst the press by a reporter in Paris who announced the news on the 7th, which in term led the soviets to begin celebrating on the 8th, and the surrender and the celebrations were duel brought forwards to 8 may 1945.
This surrender netted Montgomery a prize of 1 million German soldiers, plus 2 mission internally displaced persons (DPs), in addition to the civilian population present in northern Germany.
For the 1 million German soldiers’ things were often straightforward- they were given food and water, disarmed and centralised and then transport was arranged to their homes as the German army was totally disbanded. DPs were often either liberated slave labourers, fleeing collaborators from occupied territories or German civilians fleeing the advance of the Red Army. For them, thing were more complicated as many either lacked homes to return to, or would not return to them, greatly complicating the situation and creating tension between the allied powers as they struggled with their rights and responsibilities.
The experience of many allied soldiers was fundamentally dictated by their location and job role. For many infantrymen and tankers on the front lines, occupying slit trenches and foxholes took the news with a rather underwhelming air. Lacking easy access in many cases to alcohol, women, clean clothes etc, were often ordered to occupy their positions and often simply slept a little better as they waited for the news to filter down, often the received a warm meal as field conditions were lifted, but otherwise they remained in the field and woodblocks, nervous as they waited for the German Army to honour the surrender. Others got lucky, consider the famous example of easy company liberating the eagle's nest, while Buckley relates a story of a hussar regiment who 'liberated' Hitler's personal yacht, and spent VE shooting off rescue flairs and partying aboard with a detachment from the WAACs. Those units further behind the lines in combat support and service support positions often benefited from their proximity to the civilian population to party. For 1st airborne division (of Arnhem fame) they received the news that they would be sent to Norway to take control of the 14 surrendered German divisions in the area, with the approx. 7-8,000 men taking responsibility for 350,000 German soldiers.
There was still much hardship to bear however. The liberation of concentration camps for example had been greatly delayed as many commanders re-routed frontline units to avoid the locations, often being magnets for disease such as typhoid which would rip through an infantry battalion or armoured regiment (Buckley, J, 2014). When allied combat troops did arrive the lacked the resources, experience or training necessary- an armoured recce or foot patrol of section or platoon strength stumbling upon a camp of tens or hundreds or thousands. Many were moved to offer the inmates food or water. Unfortunately, the rations were often so calorie heavy that the bodies of the inmates on starvation rations rejected the food, and starved to death with full bellies. Often the inmates remained at the camp for several days afterwards, the only solution to keep them centralised until homes could be found for them.
Upon liberation the horrors did not end. While Jews, political prisoners and the like were free to go homosexuals remained behind, while Russian POWs were turned over to the tender mercies of the red army, where the were executed or sent to the gulag as cowards, traitors or collaborators. The burden of forcing their liberated prisoners unwilling back to their homeland often fell at the lowest level, Doherty records a story of a company commander who had liberated a young Russian boy from a German Osttrupp unit during the Italian campaign. His cheery disposition led to him becoming a mascot for them, and he was given a suitably cut-down and tailored British uniform to wear, complete with Browning Hi-power on his hip as he acted as runner and talisman. He was turned over to the red army, tearful and screaming and shortly afterward executed as a coward and collaborator (Doherty, R., 1999).
Return home was for many allied troops a gradual drawn down, lasting somewhere in the region of 3-24 month as armies established garrison forces such as 'British Forces Germany' or 'British forces Austria.' units for demobilisation were returned, units for garrison duty had their personnel slowly rotated, and those individuals who wished to make a career of the army tried to find jobs several ranks below their level of competence as brevet/wartime ranks reverted to substantive.
Sources
Montgomery, B.L., Memoirs, (Barnsley, Pen and Sword Ltd., 2007)
Buckley, J., Monty's Men (Yale, Yale University press, 2013)
French, D., Raising Churchill's Army, (Oxford, Oxford University Press, 2000)
Doherty, R., A Noble Crusade (Staplehurst, Spellmount Ltd., 1999)
First, some context for the surrender of Germany from the allied point of view.