GithubHelp home page GithubHelp logo

adityakumar48 / getting-started-with-open-source Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arpit456jain/getting-started-with-open-source

0.0 0.0 1.0 709 KB

step by step guide for beginners for getting started with open source

License: MIT License

Python 100.00%

getting-started-with-open-source's Introduction

Step-by-Step Guide for beginners for getting started with Open-Source

Here The Contribution Begins💻

If you are a beginner then this repository is for you. By this tutorial you are going to learn how to make your First Pull Request for sure.

⭐ STAR THIS REPOSITORY THIS WILL PAY OFF MY WORK


1. The first thing you need is Git installed on your system, if it is not installed then download it as per your OS and install it.

Git Setup :-

  • Download Git as per your OS.
  • Git installation Video as per your OS.
  • Install Git
  • Open the Git Bash ( Right Click )
  • Run the Commands
  • $ git config --global user.name "Your Name"

    $ git config --global user.email [email protected]

    $ git config --list

  • You should be able to see your entered name and email under user.name & user.email


2. You should have an account on GitHub if you you dont't have an account then simply make it.

3. You will need a text editor accoring to your comfort , I prefer Vs code

Other Text Editors

4. Now you just have to setup the project from GitHub to your local system.

Setting Project on your Local System :-


  • Fork this Repository or Project
  • This will create a copy of this repository in your account.


  • Copy the link of the Repository



  • Open Git bash where you want to clone the project and clone it
  • Clone it
  • Run Command and Hit Enter
    git clone <the link you just copied>
    



    In this case it is
    git clone https://github.com/arpit456jain/Getting-Started-with-open-source.git

  • After you hit enter you will notice that some downloading will start. It's actually cloning of repo form your GitHub repository to your local system.

  • After this you will notice a folder is created with the name of repository



  • Then just close the Git bash and open this folder in your preferred text editor...

  • Here is an example in VS Code.



5. Now Make necessary changes and commit them , lets say you have to add your name in readme , you already set up the project in local system . Now before starting your work always rembember to pull latest change from the main Repo.

  • Fetch And Merge



  • Pull these changes in your local system

  • ``` git pull origin master ```



  • make a new branch and then make the changes , then commit them. make sure to commit to the new branch
    Never commit in master branch
  • git checkout -b new_branch_name
    git add -A
    git commit -a -m "message"
    
  • After commiting your changes on your local host you have to push that changes to GitHub , make sure you push the new branch
  • git push origin new_branch_name
    

6. Make the Pull Request

  • when you push the changes you will notice a new branch will be created on GitHub and there will be a green button for creating pull request. Click on it.



  • After this a new page will be open like this


  • Now add a title and description of your PR and click on create pull request.

  • Congrats 🎉 your Pull Request is created




Some Common Error And Their Solutions

1. Updates were rejected or failed to push some refs.


This is most common error you will find and its pretty easy to solve .


Solution: You just have to pull latest changes to your local system first and then you can push them

git pull origin master

Note : if your repo is a forked one and its some commit behind then first fetch n merge then pull changes

2. Unable to detect identity.


Its pretty easy to solve .


Solution: You just have to write your username and email

git config --global user.name "Your Name"
git config --global user.email [email protected]

Common Git Commands you should know!!!

1. Git checkout

  • You can use the checkout command to switch the branch that you are currently working on.
  • git checkout <branch name>
    

    2. Git init

  • This is the command you need to use if you want to start a new empty repository or to reinitialize an existing one in the project root. It will create a .git directory with its subdirectories.
  • git init <repository name>
    

    3. Git diff

  • You can use this command to see the unstaged changes on the current branch.
  • git diff
    
  • If you want to see the staged changes.
  • git diff --staged
    
  • Or you can compare two branches:
  • gif diff <branch1> <branch2>
    

    4. Git add

  • This is the command you need to use to stage changed files. You can stage individual files.
  • git add <file path>
    
  • You can also stage all files.
  • git add .
    

    5. Git branch

  • Using git branch will list all the branches of the repository.
  • git branch
    
  • Or you can use it to create a new branch, without checking it out.
  • git branch <new branch>
    
  • To delete a branch.
  • git branch -d <branch name>
    

    6. Git log

  • If you want to see what you have committed till now.
  • git log
    
  • If you want to see last 5 commits among 100000 commits.
  • git log -p -1
    

    7. Git merge

  • Merge the changes made in a staging branch into the stable branch.
  • git merge <branch_name>
    

    8. Git rm

    Remove files or directories from the working index (staging area). With git rm, there are two options to keep in mind: force and cached. Running the command with force deletes the file. The cached command removes the file from the working index. When removing an entire directory, a recursive command is necessary.

  • To remove a file from the working index (cached)
  • git rm --cached <file name>
    
  • To delete a file (force)
  • git rm -f <file name>
    
  • To remove an entire directory from the working index (cached)
  • git rm -r --cached <directory name>
    
  • To delete an entire directory (force)
  • git rm -r -f <file name>
    

    9. Git stash

    To save changes made when they’re not in a state to commit them to a repository. This will store the work and give a clean working directory. For instance, when working on a new feature that’s not complete, but an urgent bug needs attention.

  • Store current work with untracked files
  • git stash -u
    
  • Bring stashed work back to the working directory
  • git stash pop
    

    10. Git clear

  • To clean git bash.
  • git clear
    

    What if I have Merge Conflicts?

    A GitHub conflict is when people make changes to the same area or line in a file. This must be fixed before it is merged in order to prevent collision in the main branch.


    Now just make a Pull Request and add your name in Read me file.

    CodeSmashers Community


    Arpit Jain


    Ankita Puri

    ✨ Contributors

    Thanks go to these Wonderful People 👨🏻‍💻: 🚀


    Contributions of any kind are welcome!

    Open Source Programs click here

    Some Open Source Projects you can contribute to.

    Project Name Tech Stack
    PixelVibe HTML , CSS , Bootstrap , Java Script , Python , Django

    show some ❤️  by giving the star to this repo

    getting-started-with-open-source's People

    Contributors

    adityakumar48 avatar alankemboi avatar ankitapuri avatar arpit456jain avatar astha2412 avatar geeky01adarsh avatar shivaprasadyanala avatar sidparashar2001 avatar

    Forkers

    tarunk0

    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.