git – push an ‘unchecked out’ branch

Question:

I want to push a branch (not the current) without having to check it out first, how can I achieve that ?

this is how I’d do:

but checking out feature can cause conflicts, can’t I just push another branch than the current one ?

Answer:

Simply:

Or shorter:

Leave a Reply