Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

¿Can you add a warnig to move? #473

Closed
biblioclasta opened this issue Dec 6, 2014 · 7 comments
Closed

¿Can you add a warnig to move? #473

biblioclasta opened this issue Dec 6, 2014 · 7 comments

Comments

@biblioclasta
Copy link

Hi,
I love ungit, but "move" has quit an inocent name for such dangerous function.
Can you add a warnig to move?
Or an option to hide move?

@Ajedi32
Copy link
Contributor

Ajedi32 commented Dec 9, 2014

Related: #124

Also FYI, move actually isn't that dangerous. Any commits you might "lose" with move are easily recoverable from the command line. I agree it's bad UX though.

@ivitivan
Copy link

What does 'move' do? And how can I recover my commits?

@ivitivan
Copy link

Oh, I found #428.
I recovered commits using git reflog and cherry-picking these commits.

@Ajedi32
Copy link
Contributor

Ajedi32 commented Nov 23, 2015

Yeah, for the record, in the future you can recover any commits lost this way by simply moving the branch back. Even if the commits disappear from ungit's UI they do still exist, and you can use the command line to move the branch back to the same commit it was pointing at before you moved it.

Basically, moving a branch is very similar to a hard reset, which can be recovered from like this:

git checkout <branch>
git reflog <branch>
# Find the commit you want to go back to...
git reset --hard <old_commit>

@ivitivan
Copy link

Thank you for the information!

@jung-kim
Copy link
Collaborator

Just to chime in, just because commit nodes are not showing in ungit, it doesn't mean commits are lost. In fact, I believe you can recover from any actions in git through git-ref once a change is committed and you are willing to go through the logs. (Now our resident git expert @Ajedi32 may need to confirm on this...)

Closing as this is not an issue.

@Ajedi32
Copy link
Contributor

Ajedi32 commented Nov 24, 2015

@codingtwinky Yeah, I did kinda explain that already. Once a change is committed to git, it's very, very hard to lose it. Unless you explicitly tell it to, git won't delete anything from its database that isn't older than two weeks. And that's for content that isn't reachable anywhere, even through reflog. For stuff that is reachable through reflog (and only through reflog), the time is 30 days (by default). And obviously stuff reachable through regular branches and tags is never deleted (since that would kinda defeat the purpose of git).

IMO #124 is the correct way to solve the actual problem being encountered in this issue. Users shouldn't need to use the command line to fix problems they created in the ungit UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants