Commit 3b125691 authored by Lartu's avatar Lartu 🐕
Browse files

Added pullall

parent 8924aa2f
......@@ -14,16 +14,27 @@ if len(args) == 0:
print(f"\n This is the Multicentralized Git Toolbox (mgit) {VERSION}")
print(f" Created by Martín del Río (www.lartu.net).")
print(f" Distributed under the MIT license.\n")
elif len(args) and args[0] == "pushall":
elif len(args) and args[0] in ("pushall", "pullall"):
gitRemote = check_output(['git', 'remote']).decode('UTF-8')
remotes = gitRemote.split("\n")
for remote in remotes:
remote = remote.strip()
if len(remote) == 0:
continue
gitCommand = f"git push -u {remote} master"
print(f"\033[1;32mExecuting:\033[0m {gitCommand}")
os.system(gitCommand)
if args[0] == "pushall":
for remote in remotes:
remote = remote.strip()
if len(remote) == 0:
continue
gitCommand = f"git push -u {remote} master"
print(f"\033[1;32mExecuting:\033[0m {gitCommand}")
os.system(gitCommand)
elif args[0] == "pullall":
for remote in remotes:
remote = remote.strip()
if len(remote) == 0:
continue
gitCommand = f"git pull {remote} master"
print(f"\033[1;32mExecuting:\033[0m {gitCommand}")
os.system(gitCommand)
else:
print("Plase use 'git' for non mgit commands")
quit(1)
#Could not resolve host
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment