Giter Club home page Giter Club logo

github_tut's Introduction

GitHub 101

This guide will help you navigate GitHub with ease.


Setting Up GitHub Desktop

  1. Start by downloading and installing the GitHub Desktop app.

  2. Sign in using your GitHub account.

  3. Pick the repository you'd like to work on.

    Select Repository

  4. Choose a local folder where you'll store the project.

    Select Folder

  5. Click 'Clone' to download the project to your local folder.


Making Changes and Committing

  1. Make any changes you want to the project.

  2. Open the GitHub Desktop app to see the changes you've made.

    Observe Changes

  3. To save your changes or commit the history, go to the bottom left of the screen, give your change history a title, and click on commit to main.

    Commit Changes

  4. Once you've committed, your changed file will no longer appear in the left menu.

  5. Click Push origin to upload your changes to GitHub.

    Push Changes


Creating Repositories on GitHub

  1. Sign in to your GitHub account on your preferred web browser.

    Login

  2. Click on the + button at the top right of the screen and select New repository.

    New Repository

  3. Give your repository a name and, if you want, add a description.

    Name Repository

  4. Make sure the repository is set to Public.

    Set Public

  5. Click on add a README file and then Create repository.

    Create Repository


Changing Repository Remote Origin

  1. Copy the URL of the new repository you want to switch to.

    Copy URL

  2. Open the repository you want to change from in VS Code and open the terminal.

    Open Terminal

  3. Type git remote set-url origin <new repository url> and press enter.

    Set URL

  4. Add, commit, and push the changes to the new repository using the VS Code UI.

    Push Changes


Understanding Git in VS Code

  • Green vertical lines next to line numbers show incoming updates to the repository.

    Incoming Changes

  • Blue vertical lines next to line numbers show outgoing updates to the repository. Click on the blue line to see the changes you've made.

    Outgoing Changes


Using GitHub Desktop

  • Green = data added to the repository

  • Red = data deleted from the repository

  • Orange = modified data in the repository

    Color Indicators


Understanding History, Reverting Changes, and Resolving Conflicts

  1. In GitHub Desktop, you'll see the history tab to the right of the Changes tab. Click on it to see the repository's history.

    History

  2. To undo changes, right-click on any history you want to revert and click on Revert changes in commit.

    Revert Changes

  3. If your changes affect or are about to overwrite the current content in your project, a prompt to resolve conflicts will appear.

    Conflict Prompt

  4. Switch to VS Code to resolve the conflict. Files marked as conflicted will have >>>>>> and <<<<<< in the file and will be colored in red or orange.

    Conflict Markers

  5. Click on the conflicted file and click on Resolve in Merge Editor. The incoming changes will be on the left side and the outgoing changes will be on the right side.

    Resolve Conflict

  6. Click Accept Incoming Change to accept the incoming changes, Accept Current Change to accept the outgoing changes, or Accept Both Changes to accept both.

  7. Click Complete Merge to finish the merge.

    Complete Merge


Branching

Branching lets you work on different versions of a repository at the same time. By default, your repository has one branch named main, which is considered the definitive branch. We use branches to experiment and make edits before committing them to main.

  1. To create a new branch, click on the Current Branch button at the top left of the screen and click on New Branch.

    New Branch

  2. Give your branch a name and click Create Branch.

    Name Branch

  3. Any changes you make on the new branch won't affect the main branch.

  4. To merge the branch into the main branch, click on the Current Branch button at the top left of the screen and click on the main branch.

    Select Main

  5. Click on Choose a branch to merge into main.

    Choose Branch

  6. Click on the branch you want to merge and click Create a merge commit.


Resources

VS Code Extensions for GitHub

YouTube Tutorials

Additional Sources

github_tut's People

Contributors

joechea-aupp avatar cheasingh avatar a-n24 avatar paulen101 avatar chornsokreaksa avatar hylyheang avatar chesda-ly avatar nikola-limpet avatar saturday21 avatar boreyvina avatar chan-mitona avatar cmlmenlay avatar preshyboi avatar chansonaza avatar chanveasna-eng avatar cheayeo avatar chenchanveasna avatar chhimchanbonraksmey avatar chhin19 avatar fongbunsong avatar heavseima avatar houk-y avatar linda051104 avatar jchanthy avatar keameng-ing avatar kheav-kienghok avatar kimhorng-p avatar longvathanak avatar lorn-hongnida avatar ly-minh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.