[kwlug-disc] Using the alias command with the Git Command Line Interface

John Johnson jvj at golden.net
Wed Feb 14 11:41:13 EST 2018


Adam: thanks back to you.

Again. I had forgotten about export. To my credit (very little) I do 
recall environment variables from my UNIX days.

The following is note & diagram on branching is based on experience long 
before git and similar tools.
Possible merging is shown by the + signs.
My goal: Practice with git to learn the ins and outs of branching and 
merging with git to be able to follow this diagram.

An original development is shown as A.
Development in A w/bug repairs and deployment continues.

At some time a snapshot called a base-load is taken for a next 
generation development B.
Development in stream A w/bug repairs and deployment continues.
Development in stream B w/bug repairs and deployment continues.
Reviews of bug fixes and repairs are scheduled and shown as +.
Any changes in A relevant to B are ported i.e. merged with B.
Any changes in B relevant to A are ported i.e. merged with A.

At some time a base-load is taken from B for a next generation 
development C.
Development in stream A w/bug repairs and deployment continues.
Development in stream B w/bug repairs and deployment continues.
Development in stream C w/bug repairs and deployment continues.


Reviews of bug fixes and repairs are scheduled and shown as +.
Any changes in A relevant to B are ported i.e. merged with B.
Any changes in A relevant to C are ported i.e. merged with C.
Any changes in B relevant to A are ported i.e. merged with A.
Any changes in B relevant to C are ported i.e. merged with C.
Any changes in C relevant to A are ported i.e. merged with A.
Any changes in C relevant to A are ported i.e. merged with A.

At some time EOL End Of Life is declared for stream A and development & 
support for stream A stops.
At some time EOL End Of Life is declared for stream A and development & 
support for stream A stops.
At some time EOL End Of Life is declared for stream B and development & 
support for stream B stops.

A +-----+-----+-----+-----+.....| EOL
         |
B +-----+-----+-----+-----+-----+-----+-----+-----+.....| EOL
                     |
C +-----+-----+-----+-----+-----+-----+-----+-----+.....| EOL
(use fixed width font for this diagram)

JohnJ

On 2/14/2018 11:06, Adam Glauser wrote:
> Thanks for sharing this John. For what it's worth, I've been using Git 
> for years now, and I strongly prefer the CLI over any GUI I've used. 
> That being said, I do use GUI tools for certain operations. For 
> example, see `git mergetool`. My preferred tool is KDiff3 (which is 
> available on the other OS as well).
>
> My approach to your problem is to use environment variables. An 
> advantage of this approach is that you can then refer to those paths 
> in a variety of use cases.
>
> # ~/.profile
> export P_A_DIR=/c/Users/user/projects/projectA
> export P_B_DIR=/c/Users/user/projects/projectB
>
> You can then do things like:
> $ cd $P_A_DIR
> $ diff $P_A_DIR/path/to/file $P_B_CODE/path/to/file
>
> In particular, I find this handy for referring to locations on remote 
> boxes, where I may not be able to use aliases or remote env. vars. easily.
> $ scp $P_A_DIR/path/to/file user at server:$P_A_TEST/path/to/file
>    or
> $ scp $P_A_DIR/path/to/file user at server:$P_A_RELEASE/path/to/file
>
> Hope this helps,
> Adam
>
>
>
> On Wed, Feb 14, 2018 at 10:36 AM John Johnson <jvj at golden.net 
> <mailto:jvj at golden.net>> wrote:
>
>     Update
>     A while ago I was informed about the use of alias command.
>     My Bad: I had forgotten about the alias command, as I used it back
>     when
>     was UNIX sysadm, many eons ago.
>
>     While my application is not in Linux what I have shown below shows
>     how I
>     am using the alias command with the git command window.
>     The same can apply to Linux.
>
>     In the other OS, I have placed .bashrc (shown below) in the git home
>     directory /c/Users/user/.
>     I have a number of projects, each with their own development directory
>     and git repository.
>     In the git command window, I use the alias commands shown below to
>     define shortcuts that will put me in the development directory for the
>     current project.
>
>     # .bashrc
>     # created 20180211
>     alias cdprojectA="cd /c/Users/user/projects/projectA"
>     alias cdprojectB="cd /c/Users/user/projects/projectB"
>     alias cdprojectC="cd /c/Users/user/projects/projectC"
>     # done
>
>     Next: Study & use the git control files: .gitignore and .ignore.
>
>     And yes! At this time, I prefer to use git from the command line
>     window.
>     Using the git gui will come later.
>
>     JohnJ
>
>
>     _______________________________________________
>     kwlug-disc mailing list
>     kwlug-disc at kwlug.org <mailto:kwlug-disc at kwlug.org>
>     http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>
>
>
> _______________________________________________
> kwlug-disc mailing list
> kwlug-disc at kwlug.org
> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20180214/e882ef9c/attachment.htm>


More information about the kwlug-disc mailing list