Git & GitHub- Key Knowledge

  Git  & GitHub - Key Knowledge
RELEVANT FOR  DEVELOPMENT AND DS
AVANCE LEVEL NOTES


Git is a command line tool for version control management, open source and designed to track the changes in code in a development project. With GitHub as a web-based hosting service or platform for repositories, allow us to: 
  • Created an open source repository
  • Started and managed branch
  • Changed a file and committed those changes
  • Opened and merged a pull request
There are specific commands to create, change, combine, synchronize, clone or copy code.

Commands by steps in a plaint way (just like will appear in project development process):

  • Signup to GitHub (intuitive process)
  • Create a repository (explore the options)
  • Install git (git dowload or from terminal)
    • Get the version or update in terminal:
      • git -v
      • git clone https://github.com/git/git
  • Clone the Repository
Clone the repository and make changes locally, making sure to include an index.html file which will be the landing page for your website.
    • Copy the URL and execute
      • git clone <url>
    • Open in Desktop
    • or Download
  • Connect
    • VS Code
    • RStudio
  • Make Changes
    • Commit
Each change and associated commit message (explaining what and why a particular change was made).
      • git commit -m "message"
    • Publica
      • git push
      • If are only changes and no new files try to use
        • git add .
        • git commit -am "message" #commit all the changes
    • Pull
      • git pull
        • Heard of collaboration on GitHub
        • @mention for request feedback
  • Merge Conflicts
Merge your feature branch into the main branch. It will generate some conflicts, GitHub will alert about this. You can make a commit that resolves or use a comments in the pull request to discuss about this conflicts. Is a recommend practice try to delete the feature branch after merge it, and create a new one for new changes.
    • git log
    • If have a mistake, revert back to a previous version
      • git reset
        • git reset --hard <commit> # revert to the version after that commit
        • git reset --hard origin/master #to the version currently stored online on Github
  • Managed branch
    • git branch # to see in which brach you're working
    • git checkout -b <newBrachName> #create a new brach
    • git checkout <brachName> #switch between branches
    • git merge <otherBrachName> #merge working branch with other

  • Forking - a Github fieature

Repositories

A repository, or Git project, encompasses the entire collection of files and folders associated with a project, along with each file's revision history. Some relevant components in GitHub:
  • Files
    • The file history appears as snapshots in time called commits. 
    • The commits can be organized into multiple lines of development called branches.
  • Brach
  • Rules
  • Main (production) - feature 
  • Personal Access Tokens (PAT)
  • Public or Private

Connect to Development Enviroment or Source Code Editor

RStudio Integration

RStudio is a integrated development enviroment for R.
  1. Configure the version control en Global Options de la terminal
    1.    Rutas de Aplicación ejecutable: Git
    2.    New Project - Version Control - Select Git
  1. Create a New Project From Repository
    1. New project
    2. Version control
    3. URL
    4. Create
  2. New Project  - version control - git hub - user required information - project
  3. Fallow the instruction, execute in terminal the git command for the desirable action
    1. Save | Commit | Push
Additional resource:

Visual Studio Code Integration

VS Code is a source-code editor made by Microsoft.

[ver vscode article]


Additional Resource:

Entradas populares

SQL