Lesser known Git commands
hackernoon.com
Lesser known Git commands
1–10 of 142 posts
Re: Lesser known Git commands
#2Re: Lesser known Git commands
#3Also grog is making me feel extremely groggy.
Re: Lesser known Git commands
#4The idea of `git please` is not bad but it made me wonder if it could be possible to go even further.. a variant on --force that only force-pushes IF NOT ONE HAS PULLED YET.
I can see why this wouldn't be built into git core however, as it's quite stateful and depends on tracking other people's fetches, which probably isn't easy.
Re: Lesser known Git commands
#5Warning: not actually git commands, rather TFAA's aliases for possibly useful combinations of switches and/or commands.
This article is a great way to find those hidden things.
Re: Lesser known Git commands
#6 jschroeder@omniscience:~$ git config alias.up
pull --rebase
jschroeder@omniscience:~$ git config alias.down
push
They can be used thusly: git up && git downRe: Lesser known Git commands
#7Some of the aliases are funny but could be renamed for brevity. Also grog is making me feel extremely groggy.
My aliases list is pretty small, aside from amend I have
* get (pull --ff-only --all -p), basically a hard sync with all remotes, updating the current branch if there are no conflicts or divergences
* summary (log --oneline --no-merges), given a range from git fetch/pull, provides an overview of the commits you just fetched
* original (!git show $(cat .git/rebase-apply/original-commit)) during a rebase conflict, shows the original commit whose application failed (it can be difficult to untangle a rebase conflict, this sometimes helps a lot)
Re: Lesser known Git commands
#8Re: Lesser known Git commands
#9Warning: not actually git commands, rather TFAA's aliases for possibly useful combinations of switches and/or commands.
See, switches in git are there because git maintains backward compatibility. Sometimes a switch really would logically be better as a whole new command. But it's a common refrain to hear that git hides useful things in the switches. This article is a great way to find those hidden things.
Switches are there because git commands tend to greatly leak the abstraction and group behaviour in terms of the underlying plumbing, and because Git maintainers most likely would rather add new switches to existing commands than new commands intersecting with existing ones.
> Sometimes a switch really would logically be better as a whole new command.
Which could trivially be done without BC issues and thus can't be an explanation why existing commands keep growing new switches.
> This article is a great way to find those hidden things.
It would have been a useful article if it had been about showcasing interesting or useful git switches.
Re: Lesser known Git commands
#10Warning: not actually git commands, rather TFAA's aliases for possibly useful combinations of switches and/or commands.
edit: downvote?