Git Product home page Git Product logo

dsa-prep's Introduction

Data Structures and Algorithms Prep


About this repository

This is a repository by Abhay Chauhan and Desh Iyer for practice data structures and algorithms in C++.

Table of Contents

Contributing to Public Repositories

Getting Started

  1. Fork the repository you want to contribute to using the fork button on GitHub.
  2. Go to your forked repository on github and clone it to your local machine using the following command,
    git clone <parent_repo_link> 
    For this example, let's say the repository's name is test.
  3. Go to powershell and access the cloned repository with,
    cd test/
    
    // Open with VSCode
    code . 
  4. Create a new local branch named dev on your cloned repository using,
    git checkout -b dev
    Tip: To view all branches of the repository (local and remote) use,
    git branch -a
    To just view the remote branches use,
    git branch -r
  5. Connect the local branch to an upstream using the following command,
    // We link our local branch to the parent repository by adding the parent repository as upstream
    git remote add upstream <link_to_parent_repository> 
  6. Create necessary changes in the files, add and commit them using the normal git workflow with,
    git add .
    git commit -m "<your_commit_message>"
    
  7. Push all the commits you've made on the dev branch using,
    git push origin dev
    This command not only pushes the changes to your branch, it also publishes your local branch to your remote forked repository. Now it should show up as a different branch in the branches dropdown on GitHub.

Creating a Pull Request (PR)

Once your happy with the changes on your branch, you can push all the changes in your repository to the parent repository with a pull request. You need to go to the parent repository and create a pull request on the pull requests tab. The owner of the parent repository will then be able to merge your code to one of their branches and comment on the changes that you've made.

Updating the Clone

To pull changes from the parent repository, change into the branch you want to pull changes into using,

git checkout dev

Then,

git fetch upstream
git merge upstream/main

Note: Here, upstream/main refers to the main branch of the upstream repository, i.e., the parent repository.

If you need to update a different branch, you need to checkout into that branch and run the commands to fetch and merge changes.

Deleting a Branch

To delete a branch, make sure you checkout into a branch that isn't the one you need to delete. Then, you need to first delete the local and the remote instances with,

git branch --delete dev
git push origin --delete dev

dsa-prep's People

Contributors

0xvolt avatar blood-sorcerer 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.