Fighting units of US military were integrated at the start; blacks and whites served together in the colonial forces, and black men were integrated in fighting units in the Continental Army and Navy during the Revolutionary War. This didn’t mean black men were considered equal in status or likely to end up as officers, but since the beginning the contribution of black men to the fighting forces was respected.
After the War of 1812, Army units were segregated, and during the Civil War more than 180,000 black men enlisted in the Union Army and 18,000 in the Navy. Black men fought in segregated units usually under white officers, while black men in the Navy served onboard ships in menial roles as stewards and the like. White officers doubted the abilities of black men in combat, accepting them mostly for servile roles.
Woodrow Wilson re-segregated not only the Civil Service, but the military. His decision to enter WWI led to labor shortages as drafted men were sent to Europe to fight, and black men moved to Northern cities in large numbers to take up the slack. The draft also extended to black men:
Through racially separate draft calls, the Army conscripted some 368,000 blacks, which was 13.08 percent of all those drafted. By the end of the war black draftees, prewar regulars and mobilized guardsmen combined to make up nearly eleven percent of the active Army’s total strength, some 404,000 officers and men. Black assignments reflected the opinion, expressed repeatedly in Army staff studies, that blacks in segregated units when properly led by whites could perform reasonably well. Also reflecting the consensus of white officers were the assignments given to African Americans. Most served in logistics units because of the belief that blacks could not meet the challenges of modern combined arms combat.
The four Regular black regiments did not deploy to France because they had become objects of mistrust. Posted outside Houston, soldiers from a battalion of the 24th Infantry became increasingly resentful of the city’s Jim Crow laws, the brutality of the local police, and racial insults. In July 1917 more than a hundred troops finally responded by taking arms and marching into the city. During a two-hour rampage, they killed sixteen whites and wounded twelve more. A similar episode involving men of another battalion from the regiment took place at about the same time in Waco, Texas. In that case, however, prompt action by the unit’s commanders kept a major confrontation from developing. The men involved in the incident at Waco were convicted of assault with intent to murder but received relatively light sentences. Those charged at Houston received harsh punishments. Out of sixty-four men, forty-two went to prison for life and thirteen were condemned to death. The convening authority had the executions carried out before the men had a chance to appeal their sentences.
A major reason for the collapse of discipline in these units was the loss of their veteran noncommissioned officers. With the black community clamoring for recognition and the Army drafting increasing numbers of black men, the service had established a training school to prepare black junior officers for the new black units. Many of these officer candidates came from the corps of noncommissioned officers in the Army’s black regiments. The battalion involved in the Houston riot had sent twenty-five noncommissioned officers to this program. Lacking the stabilizing influence of veteran sergeants and commanded by white officers who were either inexperienced in command or insensitive to black complaints, soldiers in this battalion gave in to their frustration and anger.
In WWII, General Eisenhower in Europe found himself short of men and integrated some fighting units by necessity. Military thinkers were looking at integration as the future, unwilling to waste the potential of black men. To demonstrate the potential, a US Coast Guard ship was crewed with black men in roles they had previously been barred from, but still with white officers. From an account by the captain of the ship and promoter of the experiment, Commander Carlton Skinner:
The next element of my reflections, while in Greenland waters, started from a very small incident. Among his many other duties, the executive officer is responsible for the advancement of enlisted men in their ratings. The Northland was a small ship, with a crew of 125. An interested officer could know the entire crew. One of the steward’s mates, [a] Negro, was a skilled motor mechanic. He loved engines and he spent his spare hours in the engine room. He came to me and asked if he could be examined for the rating of Motor Machinist’s Mate 3d class. I asked the engineer officer about the man and was informed that other Chief Motor Machinist’s Mates spoke most favorably of the man’s skills. I had him examined and submitted his papers, which were of the highest caliber, to Coast Guard Headquarters. In good time, considering our remote duty, the response came back from Enlisted Personnel at headquarters that he could not be rated as a Motor Mechanic because he was a Negro and Negroes were only accepted in the Steward’s Branch. This struck me as both unfair and inefficient and therefore undesirable for a military service. I appealed the decision, through channels, and as a result Enlisted Personnel reversed itself and authorized his transfer to Motor Machinist’s Mate and rating in that branch (I believe he later made Chief and served honorably and effectively.) [Skinner is referring to CWO Oliver T. Henry, USCG (Ret.)]
The combination of this incident with my general views on the gravity of the world crisis led me to a consideration of the whole problem of naval use of manpower. Without having statistics on the assignment of naval personnel to different shipboard duties, it seemed clear to me that the steward and steward’s mate complement of both Coast Guard and Navy ships could not exceed two to three percent of the total seagoing personnel. The universal draft was then being applied as the source of all manpower for all the armed services. This meant that the Coast Guard and Navy would have to take 11 to 12 percent of Negroes in their new manpower (the generally accepted percentage of Negroes in the U. S. population). Over a period of time this would result in the 9 percent of recruits not available for sea duty being placed in shore installations. Soon Coast Guard and Navy shore installations would be disproportionately heavy with Negro personnel.
Civil rights were in the air, and President Truman, though personally far from color blind, reported good experiences with black soldiers from his WWII service. Despite flak from Southern Democrats in his coalition, Truman signed Executive Order 9981 desegregating all US armed forces:
It is hereby declared to be the policy of the President that there shall be equality of treatment and opportunity for all persons in the armed services without regard to race, color, religion or national origin. This policy shall be put into effect as rapidly as possible, having due regard to the time required to effectuate any necessary changes without impairing efficiency or morale.
The actual process of integration took years, proceeding through Eisenhower’s administration. Truman’s Secretary of the Army from 1947, Kenneth Royall, was forced into retirement in 1949 after refusing to implement Truman’s order. Korean War battles led to manpower shortages at the front lines and black recruits were used to replace fallen whites in formerly segregated units, leading to de facto integration, and the Army officially changed its policy to conform to Truman’s order in 1951. Robert McNamara, Secretary of Defense under President Kennedy, finally directed military authorities to also use their influence to sweep away remaining discrimination by private or off-base facilities used by soldiers and their families as well.
The Army, which had historically kept black soldiers out of forward combat roles, did the opposite under full integration; black men were over-represented in ground combat forces in the Vietnam War era. Racist officers and discrimination continued to exacerbate racial tension:
After Integration. In the more than fifty years since the end of racial segregation in the Army, African Americans have continued to serve with honor and distinction. During the ten years after integration the major issues surrounding blacks in the active Army were the difficulties they encountered off-post, especially in the South; the Army’s inability to attract and retain black career enlisted personnel in large numbers; and the disproportionately small number of black officers. By the mid-1960s continuing segregation within southern state National Guards and the small numbers of African Americans in others had become a major issue.
The abolition of the quota system within units not long before the commitment of ground combat forces to Vietnam resulted in black enlisted men being assigned combat arms specialties in significantly greater numbers than their share of the American population. The inferior education many blacks had received caused them to score low on assessment tests, qualifying them only for the combat arms. During the first year ground combat units fought in Vietnam this pattern led to African Americans taking a greater number of the casualties than their share of the American population. As the draft brought more whites into an expanded wartime Army, this disparity receded, but low assessment test scores still channeled a disproportionate share of black enlisted men into the combat arms.
During the later part of the Vietnam War racial tensions in civilian society combined with growing opposition to the war to create a major disruption of good order and discipline in the Army. Many younger African American soldiers developed a new emphasis on race, which was reflected in self-imposed separation, displays of racial pride and solidarity, and quick reactions to what these soldiers felt were racial slights or discrimination, whether by individuals or the Army. The most evident displays of this new consciousness were the numerous race riots that occurred in the Army during this period at home and abroad. The younger soldiers often dismissed black career soldiers as Uncle Toms who refused to challenge inequities within the Army. This perception, along with the erosion of the noncommissioned corps during the war, greatly impeded the ability of sergeants to maintain discipline.
The Defense Department responded to this crisis by placing greater emphasis on programs designed to root out discrimination and promote equal opportunity. The Army required minority representation on all officer selection boards, sought to commission more African Americans, and increased the number of blacks attending senior service colleges. A program to achieve a more equitable distribution of black soldiers in highly technical military occupational specialties was adopted. The Army also adopted a new Racial Awareness Program designed to improve interracial communication through a formal race relations course. The cornerstone of the program was the mandatory race relations seminar. Also included were such activities as Black History Week, the observance of significant calendar events, and unit race relations conferences. These actions, together with the end of the Vietnam War, brought a gradual end to open hostilities within the service.
The end of the war also brought the end of the draft and a return to an all-volunteer force. Army planners working on this transition assumed correctly that an all-volunteer force would result in a significant increase in the number of black enlisted soldiers as whites would no longer be motivated by the draft to enlist. The first eight years of the all-volunteer force saw a dramatic rise in the number of black enlisted soldiers in the active Army, reaching 33.2 percent in 1981. The reason for this increase was that the Army offered many African Americans better opportunities than they could find in civilian life. Also increasing the attractiveness of the service was the Army’s efforts to eliminate institutional racism. The service, however, continued to have difficulty in commissioning blacks; by 1981 they accounted for 7.8 percent of the officer corps. 
The Armed Forces desegregration efforts are now considered a great success story in having established equality of opportunity, though obviously not without problems along the way. Blacks and women have risen in the ranks and now fully integrate even the highest levels. Today’s efforts to integrate more women into the armed forces are a work in progress. At the cutting edge where physical abilities are critical, women are at a disadvantage as a group, and that’s where complete integration of women is faltering as civilian-style labor regulations and attitudes imposed by politicians from above come up against physical requirements for ground combat units.
The armed forces, as Guardian Syndrome organizations, value tradition and honor — but since their traditions include civilian control and dedication to upholding the Constitution, they have been able to overcome traditional and conservative attitudes among many officers to accomplish the task required of them. As a result, they won the loyalty of a large segment of the population that had been discriminated against in civilian life. Military necessity — the need to win given the limited resources available — overruled discriminatory attitudes and eventually forced recognition of the logic of treating every soldier as an individual, not a representative of their race or class. And that is the essence of Americanism.
 From the excellent chronology of Army experience with black and female soldiers, “The Army and Diversity,” http://www.history.army.mil/html/faq/diversity.html
 “U.S.S. Sea Cloud, IX-99, Racial Integration for Naval Efficiency,” Commander Carlton Skinner, USCGR (Ret.) http://www.uscg.mil/history/articles/Carlton_Skinner.asp
 “The Army and Diversity,” http://www.history.army.mil/html/faq/diversity.html
More reading on the military:
Death by HR: How Affirmative Action Cripples Organizations
[From Death by HR: How Affirmative Action Cripples Organizations, available now in Kindle and trade paperback.]
Corporate HR Scrambles to Halt Publication of “Death by HR”
Nobody gets a job through HR. The purpose of HR is to protect their parent organization against lawsuits for running afoul of the government’s diversity extortion bureaus. HR kills companies by blanketing industry with onerous gender and race labor compliance rules and forcing companies to hire useless HR staff to process the associated paperwork… a tour de force… carefully explains to CEOs how HR poisons their companies and what steps they may take to marginalize this threat… It is time to turn the tide against this madness, and Death by HR is an important research tool… All CEOs should read this book. If you are a mere worker drone but care about your company, you should forward an anonymous copy to him.
More reading on other topics:
Jane Jacobs’ Monstrous Hybrids: Guardians vs Commerce
The Great Progressive Stagnation vs. Dynamism
Death by HR: How Affirmative Action is Crippling America
Death by HR: The End of Merit in Civil Service
Corrupt Feedback Loops: Public Employee Unions
Death by HR: History and Practice of Affirmative Action and the EEOC
Civil Service: Woodrow Wilson’s Progressive Dream
Bootleggers and Baptists
Corrupt Feedback Loops: Justice Dept. Extortion
Corrupt Feedback Loops, Goldman Sachs: More Justice Dept. Extortion
Death by HR: The Birth and Evolution of the HR Department
Death by HR: The Simple Model of Project Labor
Levellers and Redistributionists: The Feudal Underpinnings of Socialism
Sons of Liberty vs. National Front
Trump World: Looking Backward
Minimum Wage: The Parable of the Ladder
Culture Wars: Co-Existence Through Limited Government
Social Justice Warriors, Jihadists, and Neo-Nazis: Constructed Identities
Tuitions Inflated, Product Degraded, Student Debts Unsustainable
The Morality of Glamour
On Affirmative Action and Social Policy:
Affirmative Action: Chinese, Indian-Origin Citizens in Malaysia Oppressed
Affirmative Action: Caste Reservation in India
Diversity Hires: Pressure on High Tech<a
Title IX Totalitarianism is Gender-Neutral
Public Schools in Poor Districts: For Control Not Education
Real-Life “Hunger Games”: Soft Oppression Destroys the Poor
The Social Decay of Black Neighborhoods (And Yours!)
Child Welfare Ideas: Every Child Gets a Government Guardian!
“Income Inequality” Propaganda is Just Disguised Materialism
The greatest hits from SubstrateWars.com (Science Fiction topics):
Fear is the Mindkiller
Mirror Neurons and Irene Gallo
YA Dystopias vs Heinlein et al: Social Justice Warriors Strike Again
Sons of Liberty vs. National Front
“Tomorrowland”: Tragic Misfire
The Death of “Wired”: Hugo Awards Edition
Hugos, Sad Puppies 3, and Direct Knowledge
Selective Outrage and Angry Tribes
Men of Honor vs Victim Culture
SFF, Hugos, Curating the Best
“Why Aren’t There More Women Futurists?”
Science Fiction Fandom and SJW warfare