Giter Club home page Giter Club logo

github-intro-repo's Introduction

github-intro-repo

A repo to introduce those new to collaborative development on git

Link to Notion Article

GitHub in a Nutshell

  • Check if Git is already installed on your Ubuntu
git --version
  • If not
sudo apt update
sudo apt install git
  • Create a GitHub account
  • Create a repository on the website, or find a repository of interest to which you have collaborative access as follows.

Untitled

  • Click on the green button drop-down saying Code

Untitled

git clone [email protected]:rohankalbag/github-intro-repo.git

Aside: make sure to star a repo whenever you clone it to show your appreciation to the developer

  • you should see something like this

Untitled

  • enter the repository directory, to make a dummy commit onto the main branch do the following see the following code next (not recommended however), development should generally done on branches and later merged into main

Untitled

  • the above changes will be held locally to push it to the GitHub remote upstream do the following

Untitled

How to work on branches

  • I will create a branch for my commits in a branch called rohan
  • I will make a change in intro_logs.txt and make a commit

Untitled

Untitled

  • This pushes the changes only to the rohan branch on the repo and doesn’t modify the main branch

Untitled

  • how to check progress of someone else’s work on a different branch, if you are in a collaborative team ?
git switch that_branch
git log
  • What if you want to merge your changes onto the main branch without any conflicts? (very important so pay attention :D)

    • Just for an example I will make some changes on the main repo by adding something to the ./readme.md file on the remote and I have to make sure to take that change into my branch before making a pull request. Added the orange line for example

    Untitled

    Untitled

    • Now there is a change on the remote which I don’t have locally so I should be careful to consider it

    Untitled

    #this is important to prevent conflicts
    git merge origin/main
    # a pop up might come here asking for commit message, exit the window with ctrl + x
    git push

Time to create a pull request

  • Open your GitHub repo, and click on compare and pull request

Untitled

  • click on create pull request

Untitled

  • you can assign your teammates as reviewees just to make sure before merging
  • if you have discussed and you are ready to merge this into the main repository then click/ask your teammates to click on merge pull request and we are done.

Untitled

  • your changes would now reflect on the main branch of the repo, congratulations you have successfully made your first successful contribution.

You are armed with the basic skills need to collaborate on GitHub now

  • If you need some more info, always use Stack Overflow, ask people around you or check Git documentation online/the man page
man git

created with ❤️ by Rohan

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.