Germany had very strong ties to the Nationalists until the China Incident heated up enough that they felt they had to choose between China and Japan. The best elements of the Nationalist Chinese army were German-trained and the very best ones were German equipped. A German general designed China's defense strategy against Japan. The Chinese Nationalists had large orders for German weapons, including tanks.
Germany would have strongly preferred not to have to choose between the two countries. They needed Japan's fleet to help keep Britain worried about Asia and less capable of opposing Germany in Europe. They also needed China's mineral wealth. Trading German arms for Chinese natural resources was a logical fit for both countries.
The Japanese attack on China hurt Germany significantly in terms of their ability to get ready for World War II. I'm not sure what the Germans could do about it though and once the Japanese controlled Chinese ports Germany couldn't continue the trade anyway.
The real question here is how the Germans could have pressured Japan not to push the war in China. Arming the Nationalists more and quicker would have probably just moved up the Japanese invasion because the Japanese would have felt that they needed to act before the Chinese became too strong. Germany certainly couldn't project power to the Pacific enough to deter the Japanese at any point.
One possibility here: make the northern set of Chinese warlords either a lot more or a lot less competent. They were at just the wrong level of competence for the future of China: strong enough to collectively counterbalance the Nationalists and keep them from unifying most of China, but militarily close to useless against the Japanese. Make them weaker, and the Nationalists roll them up in the early 1930s and take effective as opposed to nominal control of much of China. Make them stronger, and they could oppose the Japanese effectively enough to make them the primary Japanese targets, give Chiang more time to build up.