if u ever get a tricky merge conflict, just
git push --force
. this automatically works out the right code to keep (your own)Also, a way to never have to work again!
So you’re going to git gud?
git out
git your pants
Pro tip: If your code gets flogged by git, you can always get revenge with
git reflog
😉- git pull
- git reset --hard HEAD
- try not to cry
- cry a lot
git reflog, you can get your old commits back
But I want to pretend none of this ever happened.
git can we just pretend the last 30 minutes never happened
I feel like that would get more use than people want to admit.
lemme rebase the main branch onto my branch.
two minutes later
1 merge conflict of 57 [abort] [continue]
Learning git is very easy. For example, to do it on Debain, one simply needs to run,
sudo apt install lazygit
LazyGit may actually be black magic from Satan to tempt programmers into sin. And to that I say: ‘where is a goat I can sacrifice to my dark lord?’
Wow this looks great. Amend an old commit dealing with a rebase? Sign me up!
git rebase -i origin/main
(or whatever branch you’re rebasing on), then read the instructions that come up in the editor windowRead… instructions? I love teaching people that git very often prints out what you should do next.
git: “to continue, resolve conflicts, add files, and run rebase —continue”
dev: …time to search stack overflowAll that said… just use lazygit. It does help to know CLI git first to put things in context, but if you do, no need to punish yourself every day by not using a UI.
I prefer rebasing on destination branch before merging. When merging you get all the conflicts at the same time. When rebasing you can address conflicts from one commit at a time. Untangling multiple small knots is easier than one huge spaghetti. Also commit history will be much cleaner.
Honestly, just use a GUI. Graphical user interfaces were designed for a reason. I usually use SourceTree or the Git functionality built in to Visual Studio or VS Code.
It’s good to know how things work under-the-hood (e.g understand Git’s object model, some basic commands, etc) but don’t feel like you need to use the command-line for everything.
Git is a great invention but it has a few design flaws. There are too many ways to confuse it or break it, using commands that look correct, or just forgetting something. I ended up writing simple wrapper script codebase to fix it. Since then no problems.
It was conceived for experts so the new user experience is shit and the UI is not intuitive. But it has become such a widespread standard that it is very hard to completely overhaul the UI.
Literally.
This has been the best git tutorial I’ve come across so far. Nicely interactive and gamified. https://learngitbranching.js.org/
This is great, but I just want to say that the best way to use git is to simply stop doing so much in one branch. Branches should not last longer than a week, ideally
So many orphaned branches… Poor things.
.
Lol what’s git?
A very complicated way to do
My project My project (1) My project WORKING My project (2) My project (2) (1)
Lol
It’s what americans from a rural area say when they want you to go away.
git gud. HA, GOTTEM
Yes you did