[fpc-other] Git & SVN
Graeme Geldenhuys
mailinglists at geldenhuys.co.uk
Wed May 24 13:41:00 CEST 2017
On 2017-05-24 08:21, Santiago A. wrote:
> i.e. instead of
>
> git checkout master
> git checkout develop
>
> eg switch master
> eg switch develop
Git has built-in support for alias. So you could simply define a couple
of aliases in your $HOME/.gitconfig file that mimic the above commands,
or even the SVN commands. I have over 20 aliases that I created over the
years to simply long command line parameters.
For example:
$ git config --global alias.switch checkout
will result in the following
---------[ ~/.gitconfig ]---------
[alias]
st = status -uno
svnlog = log --stat=70 --pretty=medium --name-status --reverse
...snip...
switch = checkout
----------------------------------
Now suddenly I can do this:
$ git switch develop
No need for Perl add-ons. ;-)
ps:
Above I listed two of my most used aliases as well. I have plenty of
others too.
>> git checkout master
>> git merge feature1 feature2 feature3 feature4 feature5
>>
>> ...where "featureX" is a branch name.
>
> Yes, that's very handy... and scaring.
> The merge is done magically in the repository, not in a working machine,
Everything is done locally first. So if you are not happy with the
result, it can be undone with a simple git-reset command.
Regards,
Graeme
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
My public PGP key: http://tinyurl.com/graeme-pgp
More information about the fpc-other
mailing list