Skip to content

Instantly share code, notes, and snippets.

@FernandoCelmer
Last active November 26, 2021 04:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FernandoCelmer/8a8e1a2b3f927694b0da8458720b6e10 to your computer and use it in GitHub Desktop.
Save FernandoCelmer/8a8e1a2b3f927694b0da8458720b6e10 to your computer and use it in GitHub Desktop.
script_merge_branch
import os
print('Option: ')
options = ['UPY-#', 'CS2-', 'No Task', 'Sem Tarefa']
for index, text_option in enumerate(options):
print(str(index) + " - "+ options[index])
option_num = int(input())
option = options[option_num]
print('Branch: ')
list_branch = input()
print('Merge Branch: ')
merge = input()
if type(list_branch) in(str, int):
list_branch = str(list_branch).split(",")
if list_branch:
for branch in list_branch:
if option_num in [2,3]:
os.system("git checkout " + str(branch))
else:
os.system("git checkout " + str(option) + str(branch))
os.system("git pull")
os.system("git merge " + str(merge))
os.system("git push")
print("===== Merged branch " + str(branch))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment