Git is a technology which can be endlessly explained, but sometime demonstrations are best.
What does a typical day look like for you and your relationship with git
?
Git is a technology which can be endlessly explained, but sometime demonstrations are best.
What does a typical day look like for you and your relationship with git
?
For further actions, you may consider blocking this person and/or reporting abuse
Oldest comments (41)
I use git constantly. Doing Open Source work a lot and actually having an interest in learning git deeply motivates me to spend a lot of time screwing around with it!
I stick to the basics and really only add, commit, and push!
What about branching practices?
Ah! Iβve always used feature branches off of master that are small and try to keep them open for only a few days.
he always push to master π€
Me too, that's 99.9% what I do when I use git
Add. Commit. Push. Exhale.
I use VS Code git gui for branching, adding, committing, merge conflicts. I use git command line for rebasing, resetting, looking at logs, reflogs and pushing.
I'm using Tower on Mac, and the git extension of VSCode, my best days of using
git
is when I'm only pushing into themaster
branch on my personal projects.Mostly the basics, as others are saying. Add, commit, push, merge. Occasionally I'll have a legitimate reason to use
cherry-pick
, which always feels fun to use for some reason.Even when it is just myself working on something, I try to avoid commands that "rewrite history", so I don't get in the habit of using them.
Things I've been trying to do more of lately:
A neat "trick" I recently learned is how to merge branches without switching to them. Not really needed often, but feels cool to use:
Essentially you're saying fetch
.
(as an alias for local), get the head / latest commit of {localBranchA}, and then fast-forward {localBranchToMergeAInto} to point to it. See this for details.Branch, add, commit, push, pr/merge & delete remote, delete local, repeat.
We use Bitbucket at work and I normally find myself creating branches there instead of directly in git... Then the usual.. lots of commits and then push to origin
Fairly often find the need for a rebase, occasionally a cherry pick, and when everything goes terribly wrong, a bisect to find where it all went pear shaped π
Pretty much only add, commit, push, & merge like everyone else has said. I've starting implenting some CI/CD type stuff into my projects so that has me working with Branches a lot more.
Biggest thing I'm really focusing on is writing more useful commit messages. Too many have just been "stuff" "more stuff" and "idk" which isn't a super huge problem when I'm working on stuff myself, but it definitely won't fly when actually working with a team.
Hey, I know it's behind a paywall but I'm still gonna mention it. I published a git course a while back on Egghead (egghead.io/courses/productive-git-...). The goal of the course was not to be just another "I'm a git magician" type of course, but rather to show a few IMHO simple git commands that can dramatically improve your dev experience. In fact the course describes pretty much what I'm using on a daily basis and what proved to work (at least in my case).
It's a mixture of
--fixup
commits to later autosquash)master
meanwhile)master
once reviewed and ready (to have a linear git history)Also, using conventional git commit messages for better readability, like