create or update project on GitHub

February 19, 2023 Reading time: 3 minutes

This is a personal step by step procedure to be updated.

Create (via command lines)

  1. open a terminal

  2. get the path to your project folder stored on your device

  3. write cd (for change directory) and then the path. For instance:
    cd Documents/www/project
  4. initialize the repository
    git init
  5. push all files (.) from this /project folder into staging (wait line)
    git add .
  6. push the package from staging to local repository and provide a message into quotes
    git commit -m "initial commit"
  7. create distant repository on GitHub (New repository) and copy the URL (https://github.com/username/project.git)

  8. push the package from local repository to distant repository

    1. indicate which repository you are aiming (replace "URL" by the one you copied on step 7)
      git remote add origin URL
    2. push it
      git push -u origin master
    3. enter your username and token

  9. verify result on GitHub

Update

via Code - OSS

via Command lines

  1. open a terminal

  2. get:
  3. write cd (for change directory) and then the path. For instance:
    cd Documents/www/project
  4. push all files (.) from this /project folder into staging (wait line)
    git add .
  5. push the package from staging to local repository and provide a message into quotes
    git commit -m "changed this"
  6. push the package from local repository to distant repository

    1. indicate which repository you are aiming (replace "URL" by the one you copied on step 2). Branch "master" and URL are optional
      git remote add master URL
    2. push it. Branch "master" is optional
      git push -u master
    3. enter your username and token

  7. verify result on GitHub