- cross-posted to:
- linuxfr@jlai.lu
- opensource@lemmy.ml
cross-posted from: https://lemmy.ml/post/14581344
aport ( @aport@programming.dev ) 29•2 months agoReminder to read the official git book. It’s free and it’s useful. My dudes, stop pretending to understand your tools and actually learn them.
catloaf ( @catloaf@lemm.ee ) English14•2 months ago The Doctor ( @drwho@beehaw.org ) English2•2 months agoMadness!
ulterno ( @ulterno@lemmy.kde.social ) English24•2 months agoLooking great. Thanks.
saigot ( @saigot@lemmy.ca ) 18•2 months agoI like this graphic, some of my favourites:
git log --oneline
is super useful for getting just a list of title of commits and nothing elsegit bisect
is a little known but extremely useful git archaeology command that automates binary searching for a regression. fmstrat ( @fmstrat@lemmy.nowsci.com ) English5•2 months agoYou’re gonna love this then:
alias gl='git log --graph --abbrev-commit --no-decorate --date=format:'\''%Y-%m-%d %H:%M:%S'\'' --format=format:'\''%C(8)%>|(16)%h %C(7)%ad %C(8)%<(16,trunc)%an %C(auto)%d %>|(1)%s'\'' --all'
I have a whole rc file full of shortcuts like this for Git and Docker.
lars ( @lars@lemmy.sdf.org ) 3•2 months agoNobody loves pedantic escaped single quoting more than I.
Except for you wow.
Show us the
rc
.
caseyweederman ( @caseyweederman@lemmy.ca ) 3•2 months agoI just learned git bisect from https://ohmygit.org/! You run it, then checkout other commits all over the project, and mark them with git bisect good or git bisect bad. Then it paints all commits that led to the good one as good, and all the ones after the bad one as bad, so you just keep narrowing your window by playing checkout Jezzball until there’s only one commit left: the one that introduced the bad state.
catloaf ( @catloaf@lemm.ee ) English9•2 months agoThe technical term is binary search.
caseyweederman ( @caseyweederman@lemmy.ca ) 1•2 months agoYeah but I didn’t know that term until I looked it up. Also OhMyGit didn’t cover using tests and automating it.
huginn ( @huginn@feddit.it ) 2•2 months agoDefinitely a useful tool and one you should’ve learned in a college algorithms course. Binary search backs a lot of high performance data structures
stepanzak ( @stepanzak@iusearchlinux.fyi ) 12•2 months agoGreat cheat sheet, but has a really poor quality, even when I download it. It may be problem on my side. The original on mastonon has good image quality.
I’ve edited this post and linked to the original on Mastodon.
saigot ( @saigot@lemmy.ca ) 1•2 months agoccan you link the higher wuality one here in a comment, I don’t think It’s propagated.
moe93 ( @moe93@lemmy.ml ) 16•2 months agoStill low quality.
EDIT: here is a link to a higher resolution. Link
Thanks!
𝘋𝘪𝘳𝘬 ( @Dirk@lemmy.ml ) 8•2 months agotl;dr
git add . git commit -a git push
ulterno ( @ulterno@lemmy.kde.social ) English5•2 months agoIs there anyone other than me who read
reflog
as re-flog the first time? boredsquirrel ( @boredsquirrel@slrpnk.net ) 4•2 months agoThe only stuff I need, that should be easier
- commit all changes
- commit to other branch
- squash all commits to one
- configure a ssh key per user (especially when using different accounts, different username etc)
catloaf ( @catloaf@lemm.ee ) English5•2 months agoCommit -a isn’t easy?
Squashing is easy too, though no, there isn’t a “squash all” option, unless you’re working in a feature branch and check out master and git merge --squash branch: https://graphite.dev/guides/git-merge-squash
I’m sure there’s a way to commit to another branch without having it checked out, but that just sounds like a recipe for trouble.
And I have no idea how you’d manage to not have different ssh keys per user. You shouldn’t be reusing keys across accounts to begin with.
beeng ( @beeng@discuss.tchncs.de ) 4•2 months agoLazyGit
For the lazy…
Fedop ( @Fedop@slrpnk.net ) 1•2 months agoLove lazygit, am I better or worse a git now? Idk but I’m doing it much faster
toastal ( @toastal@lemmy.ml ) English3•2 months agoTangent are these VCS Rosetta Stones that might be interesting to some:
-
Darcs/Git/Mercurial: https://darcs.net/RosettaStone
-