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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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

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.

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
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,849 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you