Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

gitpython runs my script for my own repository but it doesnt work for organization repository

Nadeem Syed April 7, 2020

I am working on a script to automate branching, when i run a script it creates a head and pushes creates a new remote, i tried it with my personal repository and never had issues, but when i try to run it on my organization repo, it doesnt throw any error but i dont see a remote branch.

origin = cloned_repo.remote()
created_branch = cloned_repo.create_head(branch_name)
print("created branch :", created_branch)
origin.push(branch_name)

1 answer

0 votes
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 7, 2020

Hello @Nadeem Syed ,

I'm not familiar with gitpython at all, so just guessing based on what you observed. Can you check that origin (cloned_repo.remote()) looks right? Maybe you have multiple upstreams, and origin is not where you're checking if the branch was created?

Another possibility is if you're checking via UI, Bitbucket won't show merged branches when you first open list of branches. Since there're no commits on that newly created branch, it is considered as merged. Can you check by switching to All branches from just Active branches in the dropdown above the table and see if that helps?

Cheers,
Daniil

Nadeem Syed April 8, 2020

i did and i was only able to get one origin and for all branches i did check that as well, would there be any access issue for this ? as even tho the user has full write and read access.

Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 8, 2020

I don't think so, otherwise I'd expect it to fail on the last line (push). Can you enable verbose logging for gitpython and check the output of the remote server for the push?

Cheers,
Daniil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events