The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I want fetch branches which I created

Suchitra Shetty
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 19, 2024

I wnat fetch all branches and delete unwanted branches

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Peter Van de Voorde
Community Champion
December 19, 2024

Hi @Suchitra Shetty ,

Welcome to the Atlassian Community. 

Here is an Atlassian Git Tutorial that will help you figure this out: https://www.atlassian.com/git/tutorials/syncing/git-fetch

Cheers,
Peter

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 20, 2024

Hi @Suchitra Shetty,

Just adding to Peter's reply that if you want to delete certain branches after fetching them locally, you can do it the following way:

Deleting a local branch

You can use the following command to delete a local branch:

git branch -d branch-name

This will delete the local branch with the name branch-name. It will not delete the remote branch with the same name that exists in Bitbucket.

Deleting a remote branch

If you want to delete a remote branch named branch-name, you can run the following command:

git push remote --delete branch-name

remote is usually origin, but it could be different. You can run the following command in your clone to find out the name of the remote:

git remote -v

Remote branches can also be deleted on Bitbucket's site from the Branches page of the repo.

Kind regards,
Theodora

TAGS
AUG Leaders

Atlassian Community Events