Summarizing the Initial Git

Given that Git is already installed.

Clone a Repo, and Make it Your Own

The scenario here is that you want some software to be the starting point of making your own application.

  • Point your terminal to the project root on your computer, eg cd projectname.
  • Clone the desired project, eg git clone https://gitlab.com/arosano/gitgo.git. This gives you a directory gitgo.
  • cd gitgo. This repo is a fully functional git repo. You must change it, so that when you improve it, and push it, the push must be to your own remote repo.
  • Create a new remote repo for the project. Note the repo url, eg https://gitlab.com/yourname/yourproject.git
  • Execute git remote remove origin. This removes the connection to the repo you cloned from.
  • Execute git remote add origin https://gitlab.com/yourname/yourproject.git. This adds a connection to your own new repo.
  • Do your work locally, commit often, and to share, and/or backup, git push
  • The work will go to your own repo, and not to where you cloned from. That is the idea.

Create Your Own Repo and Push it to a Public Repo

  • Point your terminal to your project root, eg cd projectname
  • Step by step do
    mkdir mynewproject
    cd mynewproject
    git init
    
  • Create an empty remote repo with the same name. Note the project url.
  • Execute git remote add origin https://gitlab.com/yourname/mynewproject.git
  • Do your work locally, commit often, and to share, and/or backup, git push
  • The work will go to your own repo, and when you push it, to the remote repo for sharing

You may also start with an empty remote repo, and then clone it. This way the connection url, is set through the cloning process.