3 ms·
git is like cpp, you have to use a subset: - push - pull - checkout - checkout -b - merge —ff-only - stash - stash pop - reset —hard origin/master - re
by nathants 4y ago
git is like cpp, you have to use a subset:
- push
- pull
- checkout
- checkout -b
- merge —ff-only
- stash
- stash pop
- reset —hard origin/master
- reset —soft $hash
- commit -m
- shikoba 4y ago> pull I find that command too dangerous. I only use git fetch and git merge --ff-only. You forgot git tag
- nathants 4y agoaccurate.
- kjeetgill 4y agoInteresting exercise. Mine looks more like: - push/fetch: I personally never liked pull, it's sugar over fetch and merge/rebase. - checkout -b: haven't looked into all the switch stuff yet - rebase -i: my bread and butter. I rarely use merge aside from PRs where rebase bugs people. - add/commit -am: obviously required - cherry-pick/reset: pretty much replaces stash without introducing a whole new set of tools - diff/log/status: if you get comfortable with these, you're not going to wedge yourself ever again - brach: very much an unsung hero. If you get comfortable with commiting often and using brach. You can't ever lose your place doing anything ever again.
- nathants 4y agolately i’ve been using stash, reset hard, stash pop. work on a single patch over main. use a backup branch prior to stash, just in case.
- kjeetgill 4y agoThat's reasonable, but I think a commit + a rebase -i of just that single commit gets you to the same place. And now your backup branch can preserve the code you would have stashed.