|Kanji in this term|
|は > ば|
Used for encouragement or to wish good fortune, it translates more as “do your best/give it your best” than “good luck”; compare French bon courage. In another sense, it connotes that there's always something better at the end of trying times.
As the imperative form, this might be considered rude if used in speaking directly to a single person, and consequently, this term is more often used when cheering on a team or group. To encourage a single person, the conjunctive form 頑張って (ganbatte) is more common.