6

Git tip: Before doing "git clean -fd" always think twice and backup the whole folder manually before doing that. Take it from me.
Also be careful with, "git pull" 😩

Comments
  • 1
    Oh yeah, happened to me yesterday, lost a few important untracked files !
  • 2
    git stash
  • 1
    git stash is also your best friend when you make a load of changes but, just before you commit, you notice you are on the wrong branch
  • 1
    Another tip is also to clone your branch for extra backup even if you are experienced. Just to be 100% sure sigh 😕
  • 2
    @Devnergy Why? I don't understand what are you doing wrong.
  • 1
    Always git clean -n first
  • 1
    @electrineer I'm switching to a different branch but there are lots of conflicts
  • 0
    @Devnergy so you have a lot of changes you can't commit before you switch branch? Maybe you need to have as many copies of the repository as the number of work items you are working on simultaneously. Git stash can be helpful here also.
  • 1
    Yes. Not my changes but my coworker's changes. I'll be more careful next time with git clean -fd
  • 0
    @Devnergy huh? Why would you dev on the same computer?
  • 1
    @electrineer the existing old project have not Git but recently they setup the Git for it. We have no localhost and just SSH then edit in the Dev server. Also there are 2 master branches that are not in sync but it is all sorted out now.
  • 0
    @Devnergy there's your problem. What is my reward for finding it?
  • 0
    @electrineer git stash git pop
Add Comment