A little outline of the history of the Roman Republic (1798 - 1799) based on Jean Tulard's Dictionnaire Napoléon:
The goal of the French Directorate was the recognition of the Civil Constitution of the Clergy of 1790 (which ruled that thw Bishops and Priests of the French Catholic Church had to be elected by the believers). Napoléon however wanted a quick peace since he needed a calm southern border to fight the Austrians in northern Italy. Pius VI had no other choice than to accept the peace and the annexation of the territory of Bologna, which had already been integrated in the Jacobin Cispadane Republic. Also, the Pope had to cede a great number of artworks to the French Republic.
But the compromise proved to be fragile. Within Rome, like in many Italian cities, republicans ("Jacobins") supported by France agitated against papal rule. In Rome, they were substantially supported (and manipulated) by the French ambassador. The turning point was the demonstration on December 27, 1797 on the Piazza di Spagna which should be the starting point of a general insurrection, but the French ambassador Joseph Bonaparte could prevent an outright revolt. The next day however, the Jacobins took the streets for a second time and liberated a papal chain gang. Afterwards, they gathered in front of the French embassy and demanded democratization. Joseph refused to calm the mob; papal forces fired on the crowd, killing the French diplomate general Duphot who had tried to de-escalate the situation.
The Directorate couldn't ignore this and on January 11, 1798 ordered the new commander of the armée d'Italie, general Berthier, to march on Rome and to put the Roman Jacobins in charge of a new Roman Republic - the pope should be forced to leave the city. Berthier arrived at Rome on February 9 and the city capitulated on the next day. Lead (or manipulated to state the anti-revolutionary opinion) by the French agent and former constitutional clergyman Bassal, the Roman Jacobins proclaimed the Roman Republic on the Forum Romanum (oh I love these symbols) on February 15. At the same time, they demanded protection by the French Republic. On the following day, the pope went into exile in Siena, and the cardinals left the city.
The situation worsened once again when the Directorate replaced Berthier with Masséna as general of the armée de Rome, since Masséna was impopular with the troops due to his looting and retention of the soldiers' pay. The task to organize the Roman Republic was assigned to a commission of four civilians appointed by the Directorate on January 31: Daunou, a jurist; Monge, a mathematician; Florent, a diplomat; Faypoult; Saint-Martin as secretary. The commission succeeded in the difficult task of restoring public order, primarily by replacing Masséna by Gouvion Saint-Cyr, who later became impopular with the troops for his strict discipline. Also, parts of the gigantic estates of the Catholic Church were nationalized and put up for sale. Additionally, they had to investigate the events of December 28, 1798 (8 nivôse an vi).
Meanwhile, a constitition was written, mainly by Daunou. The new constitution was indeed republican and, even if it restricted the right to vote to the upper and middle classes, quite democratic (especially compared to the other European regimes, including the Papal States). The Roman constitution of March 20, 1798 was essentially a copy of the French Constitution of the Year 3, with the names adapted to Roman history: the basic popular assemblies were called comitia; the communal assemblies tribes; the proposing chamber of parliament Tribunate; the legislating chamber of parliament Senate; the five directors Consuls; the judges Praetors; the mayors of large cities Aedils; and the comptrollers Quaestors. Daunou later took part in the writing of the French constitution of 1799 and many of these names were recycled for napoleonic institutions.
More controversial were the articles 368 (which entitled the French general of Rome to appoint the first officials and members of parliament without popular elections) and 369 (until a treaty of alliance between France and Rome is ratified, all laws had to be confirmed by the French general; equally, the French general could legislate without the assent of the Roman parliament, and the Roman Consuls had to execute these laws). Interestingly, even peaceful demonstrations could be dispersed by the army according to article 355.
The religious policies of the Roman Republic were more moderate than those of the French government. In fact, the Roman Jacobins sought to find a compromise with the Pope, and the proclamation of the Roman Republic on February 15 actually guaranteed the papal position - but the French did not tolerate the papal presence and deported Pius VI. An ecclesiastical commission was created, which should discuss the reform and democratization of the Roman Church. But instead of adopting too radical policies, the Roman government tried to appease the clergy and just tried to limit the power of the Church. Many of the 340 monasteries were to be abolished and the number of clergymen reduced by expelling foreign churchmen. Some Church officials even supported the transformation of the center of the Christian world into a democratic republic, the most famous being the cardinal and bishop of Imola (he would become Pope Pius VII in 1800): on Christmas 1797, he gave a homily asserting that democracy and Catholic faith aren't incompatible, but that every state needs religion.
However, in January 1799, the Roman government declared that the cooperation of clergymen with rebels would be forbidden under penalty of death. This demonstrates that the clergy was a core component of the opposition to the French occupation and the government soon started to control the sermonas - and even to prescribe their content. Furthermore, religious parades were forbidden. The securalization created further resistance against the regime, and unsurprisingly, the Cult of Reason and the Liberty Trees never became really popular. Other reasons for resistance against the French occupation were the lootings and the financial burden which was the French taxes.
Meanwhile, the French Fleet had been destroyed at Aboukir on August 1, 1798, victory which gave hope to the opposition. The rebellions started again and on November 24, Neapolitan troops under the Austrian general Mack attacked the Roman Republic. The new French general Championnet had left the city to reorganize his forces, and Mack entered Rome on November 27, while only a little French garrison in the Mausoleum of Hadrian resisted. Mack was allegedly welcomed by the Roman population as a liberator from French occupation.
Championnet took back Rome on December 13, chased his enemy to the south and conquered Naples on January 23, 1799, where the Parthenopean Republic was proclaimed on the following day (the republic received a similar constitution, which was however more democratic than the Roman one since it rejected an electoral census - and if you like the title of consuls, you'll love the Parthenopean titles: Archons (the five presidents), Ephors (the constitutional judges) and Censors (control of the public education)). As in Rome, the French occupation of Naples had been preceded by a revolt of the partisans of democracy within the city on January 10.
In the Roman Republic, the political life continued; Jacobim clubs had been create and republican newspapers were published. But Catholic rebels lead by cardinal Ruffo emerged in Calabria and marched on Naples. The War of the Second Coalition had broken out and Russian as well as Austrian forces attacked the French forces in Lombardia (Cisalpine Republic). The French general Macdonald (Championnet had been recalled by the Directorate due to the unauthorized formation of the Parthenopean Republic) therefore evacuated Naples on May 5 to prevent being cut off from France.
Finally, the forces of the coalition took Rome on September 30, 1799, thus definitively dissolving the Roman Republic. Equally, the Austrian took Milan on April 29 and thus put an end to the Cisalpine Republic. The Directorate, weak and divided, wasn't able to react to this invasion. But on November 9, 1799, Napoleon replaced the Directorate at the head of the French nation. Napoléon defeated the Austrian forces at Marengo on June 14, 1800, and Murat soon entered the Papal States and the Kingdom of Naples.
The Peace of Lunéville, signed on February 9, 1801, didn't respect the revolutionary principles of national self-determination and strongly disappointed the Italian patriots and Jacobins. While the Cisalpine Republic was reconstituted, and even expanded, the Roman Republic wasn't. Napoléon wasn't opposed to the Catholic Church and had tried to find a compromise with the Papal States since 1796.
Also, the most important French enemy of the Pope, the former director La Revellière-Lépeaux had completly lost his influence. Instead, Napoléon tried to reunite the French church with the Roman-Catholic one, and these efforts culminated in the 1801 Concordate. Napoléon was trying to improve the relations with the Pope - restoring the Roman Republic just wasn't in the cards in this situation.
And when, due to new conflicts between France and the Catholic Church, French troops occupied Rome on February 2, 1808, the era of sister republics was long gone and Napoléon didn't back off from total annexation. Rome officially became a city of the French Empire on May 17, 1809.
I can think of two PODs though to save the Roman Republic:
1) An early French victory in the War of the Second Coalition. Maybe Napoléon never leaves France for Egypt, and is available to fight (and win) against the Austrians and Russians in northern Italy in 1799. The Parthenopean, the Roman and the Cisalpine Republic thus are never dissolved and preserved.
2) Napoléon doesn't take power in 1799, maybe because he dies, maybe because of other reasons. The Directorate beats the Austrians in 1800 and restores the Roman Republic dissolved by the Austrians.
Okay that was longer than I thought...
BTW I'm a proud owner of a reproduction of the flag of the Roman Republic.