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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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
Highlighted

SourceTree/Git deletes 6 hours of commits to submodule

Hey folks, just posting this here on the off chance (1) you're working in a similar pattern or (2) there is any hope of recovery. I'm about 0% confident 2 is possible, so this is probably a cautionary tale.

 

I have a "hyper-repo" that I use to pull down a number of related repositories and work on them. Each repository is a submodule. Each repository, including the hyper-repo, is on Github.

 

I just spent 6 hours working on code and committing to the submodule for one of my projects, but was unable to push because of the error "fatal: remote part of refspec is not a valid name in (no branch):(no branch)". Changing branches didn't seem to affect anything, and opening the repository individually (instead of clicking through from the hyperproject) didn't make a difference.

I tried restarting SourceTree. I figured Git is supposed to be super stable. I figured there's no way it'd ever just up and delete files that are committed to the repo without me directly doing so, right?

HUGE mistake.

Restarting and opening the hyperproject again and trying to pull seems to have rolled back the submodule *entirely*. All of my commits are just... gone.

Now, I have a new branch of the submodule named "HEAD" that I cannot switch to and cannot delete. It lists this under remotes (origin/HEAD) but that branch does not appear on Github.

I didn't heed all the warnings out there about how bad submodules are and decided the convenience was worth the finnicky way they work.  Whoops. =/

0 comments

Comment

Log in or Sign up to comment
TAGS
Community showcase
Posted in Sourcetree

[dev team] Sourcetree for Windows 2019 Preview - Dark Theme

Hi folks, While the full post is over on our blog I'd like to share the dark theme we've got planned for 2019 here directly as well to keep the discussion going.  The ...

3,467 views 19 19
Join discussion

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