I've been using Git for a year and a half now. I like it. I'm not going to stop using it. But there is one issue that bothers me. I like to save my work remotely, multiple times per day, just in case my hard drive dies. With Git, I don't see a good way to do so.
TFS has the shelveset option. I loved that. I could shelve my code every 20 minutes if I wanted to.
One option, with Git, is to push often. Although not ideal, I was doing that, and I was content. However, when I create a PR, there are sometimes 10+ commits in it. I'm also fine with that, BUT, my current team likes to have just one commit for an entire story of work. This allows us to revert that one commit if it's interfering with a release.
Another option is to push often, then squash my changes into one, so the PR has just one commit. There are two issues with this: 1) it's tedious, manual work to do so (not a big deal), and 2) sometimes there will be merges from develop mixed in with my commits. Apparently squashing over merges can't be done, or it's difficult. That is a big deal in that I can't hit my goal of one commit per PR.
I started looking into options like mirroring a repo, or creating another branch for my backups. And I kept coming back to thinking: "Really? It's this hard to save a remote copy of my work?"
The only other thing I can think of at the moment is to throw a USB drive in my laptop and do a manual copy/paste backup. I think that's unfortunate.
If someone has a better approach, please let me know. Otherwise, TFS (with shelvesets) has at least one advantage over Git.
1 comment:
Hey Bob, I'm lurking here for some reason. What I would do is push my branch up to the server, and before I'm ready to PR, I delete the branch off of the server and do any manipulations (amending commits, squashing changesets) to my local branch, and then push it back up to the server.
I've found that I just continually amend my last commit as I'm developing, adding to previous commit comment the work I've done since then. That keeps me from having to squash. Naturally, if I needed a backup, I'd just commit again on my local and squash at the end if I really cared.
I never have to merge anymore. If I want to integrate the latest from develop into my current branch, I simply rebase my current branch onto the latest commits from develop and fix any conflicts. It's been pretty smooth with that.
Post a Comment