Project Docs
  • πŸ‘‹Welcome to End2End Data Science Project Documentation
  • About us
    • πŸ’‘Who we are
  • Project Guides
    • πŸ“ͺProject Pipeline Overview
    • πŸ“ŽUnderstanding Projects
  • Fundamentals
    • πŸ› οΈGetting started
      • πŸ’»Step 1: Github
        • Working with Git & Github
          • Setting up your repository & project
          • Git Branching
          • Push & Pull
          • Pull Request
        • Resources
        • Exercise
      • πŸ’»Step 2: Python Setup
      • πŸ’»Step 3: Conda Environment
        • Working with Conda Environment
        • Resources
      • πŸ’»Step 4: MySQL, Postgres & Oracle DB
        • Quick review on SQL
        • Exercises (Under development)
      • πŸ’»Step 5: Project Setup
      • πŸ’»Step 6: AWS & GCP
        • Automation
      • πŸ“‰Step 7: Final Presentation
      • πŸš€Step 8: Docker
        • Creating Docker Image
        • Useful Docker commands
  • πŸ“”Interesting articles
    • Data Engineering
    • Data Science
    • ML & MLOps
  • πŸ“”Resources
Powered by GitBook
On this page
  • 1. Create a repository for your project on Github
  • 2. Create a repository for your project on your computer
  • 3. Remove existing local repository
  1. Fundamentals
  2. Getting started
  3. Step 1: Github
  4. Working with Git & Github

Setting up your repository & project

PreviousWorking with Git & GithubNextGit Branching

Last updated 12 months ago

1. Create a repository for your project on Github

Login to your Github account -> go to Repositories and click on New to create a new repository

Fill in Repository Name -> Description (optional) -> make it Public or Private -> Click on Create repository

2. Create a repository for your project on your computer

1. Create a new folder

If you have previously created a new directory/folder for the project, there is no need to create it again. First, let’s create a new directory in the Desktop folder for our work and then change the current working directory to the newly created one. Open Terminal or command prompt:

$ cd ~/Desktop
$ mkdir project
$ cd project

2. Git setup

$ echo "# project" >> README.md # this line creates a readmefile with content
$ git init                      # creates a repo on your laptop in the projects folder
$ git status                    # shows the status of a repository
$ git add README.md             # puts files in the staging 
$ git commit -m "first commit"  # saves the staged content as a new commit in the local repository
$ git branch -M main            # this renames the default branch from "master" to "main"
$ git remote add origin <your github project url> # This adds a new remote repository called "origin" to the Git repository
$ git push -u origin main       # This pushes the changes in the local repository to the remote repository on the "main" branch

Files can be stored in a project’s working directory (which users see), the staging area (where the next commit is being built up) and the local repository (where commits are permanently recorded), and then can be pushed to the remote repository. The diagram below provides the best representation of these.

3. Remove existing local repository

If you wish to remove existing repository and re-do the process from step 1 onwards:

$ rm -fr .git
πŸ› οΈ
πŸ’»
Git workflow by Author
Drawing