z/OS Tools & Language

Expand all | Collapse all

During Clone change the directory?

  • 1.  During Clone change the directory?

    Posted 01-14-2020 10:26

    When doing a clone it is easy to specify the directory where the clone is to be installed. But the clone will always go into a subdirectory of the specified directory using the name of the repository.

    Is there a way to change that subdirectory name?



  • 2.  RE: During Clone change the directory?

    Posted 01-16-2020 03:14

    Hi lbdyck,

    Are you sure that your statement is true, cause I can’t reproduce it:
    syntax: git clone [–very-many-options…] repository [directory]
    lets check it on pkgconf repo:

    1. git clone git@github.com:pkgconf/pkgconf.git
      clone will go to pkgconf subdirectory
      bash-4.3$ ls pkgconf/
    AUTHORS             COPYING             Makefile.am         NEWS                autogen.sh          configure.ac        libpkgconf          m4                  meson.build         pkg.m4
    CODE_OF_CONDUCT.md  Kyuafile.in         Makefile.lite       README.md           cli                 doc                 libpkgconf.pc.in    man                 meson_options.txt   tests
    
    1. git clone git@github.com:pkgconf/pkgconf.git pconf
      Clone will go to pconf directory without additional subdirectories
      bash-4.3$ ls pconf
    AUTHORS             COPYING             Makefile.am         NEWS                autogen.sh          configure.ac        libpkgconf          m4                  meson.build         pkg.m4
    CODE_OF_CONDUCT.md  Kyuafile.in         Makefile.lite       README.md           cli                 doc                 libpkgconf.pc.in    man                 meson_options.txt   tests
    
    1. git clone git@github.com:pkgconf/pkgconf.git /u/username/git/pc2
      Clone will go to /u/cskloc/git/pc2 directory without additional subdirectories
      bash-4.3$ ls /u/cskloc/git/pc2
    AUTHORS             COPYING             Makefile.am         NEWS                autogen.sh          configure.ac        libpkgconf          m4                  meson.build         pkg.m4
    CODE_OF_CONDUCT.md  Kyuafile.in         Makefile.lite       README.md           cli                 doc                 libpkgconf.pc.in    man                 meson_options.txt   tests
    

    Thanks,
    Alexander



  • 3.  RE: During Clone change the directory?

    Posted 01-16-2020 08:12

    I tried this with negative results:

    /u/slbd>git clone git@github.com:xxxx/zzzz.git feature-branch /u/me/work
    fatal: Too many arguments.

    I’m trying to pull a specific branch and put it into a new directory to work with.

    If I leave off the branch then it works - is there some trick that I’m missing?

    Thanks



  • 4.  RE: During Clone change the directory?

    Posted 01-16-2020 08:41

    You need to use -b key to specify branch.



  • 5.  RE: During Clone change the directory?

    Posted 01-16-2020 08:53

    too simple - thank you - i knew i was missing something trivial but my eyes weren’t seeing it