Overview

There is now a Git repository on Technology Nursery for use by TSSG members.  The git server was created using Carlos Bernárdez's git-server-docker image.  To access the repository, send me your SSH public key by attaching it to an email.

Instructions on locating or creating your SSH public key can be found in Connecting to GitHub with SSH.

Step-by-step guides

Prerequisites

Verify access to git server

  • ssh git@technologynursery.org -p 2222
    ...
    Welcome to git-server-docker!
    You've successfully authenticated, but I do not
    provide interactive shell access.
    ...

Refreshing your ssh cached entry for our git server

Our git-server had been upgraded back on 2018-12-05.  This caused a change in the server's private key.  If you haven't connected to the server since then, your ssh will complain about the server's identity not matching that in the known_hosts file.

  1. Clear out your known_hosts file of the invalid server certificate entries:
    1. ssh-keygen -R technologynursery.org
    2. ssh-keygen -R [technologynursery.org]:2222
  2. Follow the steps within Verify access to git server.

How to create a new repository

  • cd myrepo
  • git init --shared=true
  • git add .
  • git commit -m "my first commit"
  • cd ..
  • git clone --bare myrepo myrepo.git

List available repositories

Must have a user account on server s14.

  • ssh s14 "ls /home/ralph/Projects/git-server/repos/"
    • jenkinsJobs.git
    • LeaseLine.git
    • tssgTechBackup.git
    • tssgTech.git
    • tssgTechOriginal.git
    • tssgTechPoc.git
    • tssgWebflow.git

How to upload (publish) a repository

Must have a user account on server s14.

  • scp -r myrepo.git <user>@technologynursery.org:/home/ralph/Projects/git-server/repos

How to clone a repository to your local machine

Prerequisites

  • Your SSH public key must have been posted to Git Server
  • Add this to ~/.ssh/config

    ~/.ssh/config
    Host g14 tssg
    Hostname technologynursery.org
    Port 2222
    User git

Clone Examples

Execute these in the directory in which you wish to base your local repository (example: ~/Projects)

  • git clone ssh://git@technologynursery.org:2222/git-server/repos/tssgTech.git

or

  • git clone ssh://tssg/git-server/repos/tssgTech.git

or

  • git clone ssh://g14/git-server/repos/tssgTech.git



Currently Available Git Repositories

On 2020-05-19, these are the available repositories on our remote, private, git server:

  • LeaseLine.git: Ralph A. Navarro Jr. mobile application to assist drawing the line on automobile lease costs.

  • tssgTech.git: Web Project's tssg.tech web site.

  • tssgTechBackup.git
  • tssgTechOriginal.git:
  • tssgTechPoc.git:
  • tssgWebflow.git:
  • jenkinsJobs: Backups of changed Jenkins Jobs are committed every week on Wednesday at about 01:35 AM

Related articles

There is no content with the specified labels



3 Comments

  1. Joel Sharasheff 7/2/2018 5:19pm

    These are the steps I took to update and/or add files to the common Web development repository.

    1. From a git bash command window, cd (change directory) to the directory where the files live.
      I installed command line and GUI apps to run git for windows 64 bit from mingw.org.
    2.  connect to TSSG git server:  
      ssh git@technologynursery.org -p 2222
    3. To get information related to this repository, you could (at any time after connecting) call these log and status commands.
      git log
      git status
    4. To check in new files and changed, existing files with a comment.
      git add schedule.php
      git commit -m "holds the initial format for schedule display"
    5. To finalize all of the changes and share with others, push all changes to the repository.
      git push

    To verify that all changes were committed and shared correctly, you can grab a full copy of the latest data.

    1. mkdir test or some sort of temporary directory to store the tssgTechMVP directory and its sub-directories.
    2. cd test
    3. from a git bash command window, make sure that you are connected to the TSSG git server. See step 2 in the first section.
    4. git clone ssh://g14/git-server/repos/tssgTechMVP.git
    5. all of the latest files should be pulled into test/tssgTechMVP.

      There are probably ways to simplify your git commands and get the work done quicker, but these will get you started.
    1. Connecting to the TSSG git server will just verify that you can connect.  It is only needed when you want to verify that your public key is on the server so that you can be authenticated to access the source files.  You do not need to run ssh every time you do a git clone, or git pull, or git push.

      You cannot run a git log or git status unless you have already cloned the repository to a local directory and have changed directory (cd) to the local location of the source files (as Wayne Garmil points out below).

      How about this for a better workflow:

      Starting Out

      1. If you don't already have a public/private key pair, create one.
      2. Send only your public key to Ralph.  Keep your private key within your .ssh folder.  Do not share your private key.
        1. Ralph will add your public key to the server.  This will enable the server to recognize you when you attempt to connect.
        2. Ralph will notify you once your public key is on the server.
      3. Verify that your connectivity to the server is authenticated by running:
        • ssh git@technologynursery.org -p 2222
      4. Clone the repository that you want.  The following will clone the repository into a tssgTechMVP folder within the current directory.
        • git clone ssh://git@technologynursery.org:2222/git-server/repos/tssgTechMVP.git
      5. Change to the folder containing the repository (i.e. tssgTechMVP folder)
        • cd tssgTechMVP
      6. You can now do various git commands to the local repository contained within the tssgTechMVP directory.

      Development Workflow

      Repeat the following workflow whenever you want to commit changes.  This is one way to minimize having to do address merging changes which could slow you down.

      Pull the latest updates locally

      Do this every time before you start to change any files.

      1. Run the following from within the local repository directory (e.g. tssgTechMVP).  This will pull the latest changes from the remote repository to your local repository.
        • git pull


      Make changes to files in your local repository and commit them.


      1. Change files with your favorite editor.  However, make sure you save the file using UNIX line endings.
      2. Add your changed file(s) to the set of files to be committed.
        • git add <file(s)>
      3. Commit your changes to your local git repository.
        1. git commit -m "Enter a commit message here..."

      Push your local changes to the remote repository

      1. git push


  2. Joel's comment above using the git clone command is good of you have not yet created a local copy of the repository.

    If you have previously done the git clone command, and just need to get the updated file(s), then do the following commands:

    1. start the GIT bash command line program
    2. cd to the directory where you had previously run the git command (example: cd test)
    3. run the git pull command (git pull)

    This will download all the changes from the git server into your local repository.

    It is strongly recommended that, before starting to make changes to files in your local repository, you run the git pull command.  This will ensure that your local repository is up to date, and help avoid conflicts when you go to push your changes later on.