What git gotchas have you been caught by?

后端 未结 9 2047
半阙折子戏
半阙折子戏 2020-12-25 08:51

The worst one I\'ve been caught by was with git submodules. I had a submodule for a project on github. The project was unmaintained, and I wanted to submit patches, but co

相关标签:
9条回答
  • 2020-12-25 09:35

    It's not a gotcha, it's a gitcha.

    0 讨论(0)
  • 2020-12-25 09:47
    1. Work work work
    2. Stash changes
    3. Fetch latest
    4. Rebase
    5. Get conflicts, fix them
    6. Forget to "git rebase --continue"
    7. Pop stash
    8. Realize I forgot to "git rebase --continue"
    9. git rebase --abort
    10. Changes I stashed originally - pfffft, gone.
    0 讨论(0)
  • 2020-12-25 09:47

    Work work work ...

    git commit
    

    Work work work ...

    git commit
    

    Hm... time to integrate

    git rebase -i origin/master
    

    What? Conflicts? Let's start again

    git reset --hard origin/master
    

    Cry cry cry...


    Git lets you wipe your local history without remorse. The biggest gotcha is that you are the safety net.

    0 讨论(0)
提交回复
热议问题