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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,410,249
Community Members
 
Community Events
169
Community Groups

Git flow post-initialization issue recovery

I recently removed my development branch using git branch -D development in order to clear some commits it had that I did not want to preserve between feature commits.

The result was that finishing the (still present and active) feature branch I had open through the Git Flow button caused a complaint that git flow had not yet been initialized (it had).

This resulted in the rather annoying need to track down its real location within the SourceTree.app/Contents/ hierarchy and run git flow init again by hand.

Ideally Source Tree should automatically attempt to recover from detectable and straightforward git flow init issues such as this, saving people the lengthy run-around.

3 answers

1 vote
KieranA Rising Star Mar 10, 2013

Hi Walter,

With git flow the idea is that you don't manually create/delete branches yourself, you solely rely on git flow to do this. Upon deleting branches git flow will definitely get confused as it's expecting the branches it manages itself to be present. If they're not then it assumes git flow hasn't been initialised. This isn't a SourceTree thing, you'll probably find the exact same error is returned if you try to do the same thing in the terminal.

We'd love to be able to automatically recover from cases like this, but git flow creates branches and it may have been a case of an accidental removal of a branch. We never want to make any assumptions about the users' particular situation otherwise we could do damage to their repository, this is why the user explicitly makes the decision to initialise their git flow repository.

Hopefully that helps, if you've got any more questions or comments feel free to fire away!

If you go to Sourcetree Settings via the gear icon on the right-hand side of the app', then click on Edit Config File, you'll see what branches etc. gitflow expects. In your case, you could have probably just recreated the local development branch, and gitflow would have worked as expected.

@Kieran Senior, so my take on this and on using SourceTree in general and SourceTree GitFlow is to execute all commands within and using the SourceTree.app and not to execute commands from the command line to prevent these types of inconsistencies which makes sense, but it takes a little getting used to especially when starting to use the SourceTree.app in your workflow, but fortunately the learning curve seems to not be too steep.

KieranA Rising Star May 07, 2014

The only reason we say to do it from within SourceTree is because people often use different scripts from the one SourceTree uses which creates inconsistencies. It's not because we're trying to coerce users into using SourceTree.

Technically you could do it from both the terminal and from SourceTree provided your git-flow configurations matched so the branch prefixes matched correctly. Otherwise, one script would create a different naming convention to the other meaning the terminal and SourceTree would produce different output for the same function.

Hope that helps

@Kieran Senior, thanks for the clarification which makes sense from my previous comment.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events