Skip to content

Instantly share code, notes, and snippets.

@raul-gracia
Last active January 7, 2021 19:06
Show Gist options
  • Save raul-gracia/ec3bdf00dc9347f849b088cf78882ac0 to your computer and use it in GitHub Desktop.
Save raul-gracia/ec3bdf00dc9347f849b088cf78882ac0 to your computer and use it in GitHub Desktop.
Github Instructions

GITHUB INSTRUCTIONS

OPTION 1: GITHUB DESKTOP APP

1. Open Github Desktop App

2. Create a new repository

New Repo

3. Fill the details on the form and click create repository

New Repo Form

4. Copy the files from your project into the folder for the repo

4.1 Clic on Show in Finder to open finder on the folder of the repository

Show in Finder

4.2 Drag and drop the files from your project into the github repository folder

Drag and Drop

5. Commit the new files in the repo

Commit new files

6. Publish and Push the changes to github

6.1 Click on Publish Repo

Publish and Push

6.2 Fill the form and click on Publish Repo

Publish Form

OPTION 2: COMMAND LINE

Basic Terminal Commands usage

  • cd -> [Change Directory] used the navigate through the computer folders
  • ls -> [LiSt Directory] used to list the contents of the current directory
  • pwd -> [Print Working Directory] used to display the current directory path
  • mkdir -> [Make Directory] used to create a new directory
  • mv -> [Move] used to move files from one directory into another
  • cp -> [CoPy] used to copy files from one directory into another

Basic Git Commands usage

  • git init -> used to initialize a new git repository inside a folder
  • git add . -> used to add all the files in the current diretory into the git stage area
  • git commit -m 'message' -> used to create a commit with all the files currently on the stage area
  • git push origin main -> used to push all commits to the origin server (usually github) for the main branch
  • git pull origin main -> used to pull all the changes from the origin server (usually github) for the main branch
  • git status -> used to check the current status of the git repository

1. Open Terminal.app

2. Move to the folder where you want to create the new repository

cd ~/Documents/GitHub

3. Create a new folder

mkdir your-project

4. Move inside the folder you just created

cd your-project

5. Initialize a new git repository inside the current folder

git init

6. Open Finder in the current directory and copy the files of the project

open .

7. Add the files to the git stage area

git add --all

8. Commit the files on the stage area

git commit -m 'message'

9. Create a new repository in Github.com

9.1 Go to github.com new repository url

https://github.com/new

9.2 Fill the form to create a new repo

New Repo Github Form

9.3 Run the instructions on the Github screen on the section "...or push an existing repository from the command line" in your termal

git remote add origin git@github.com:raul-gracia/your-project.git
git branch -M main
git push -u origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment