Code Monkey home page Code Monkey logo

algorithms's Introduction

algorithms

Miscellaneous algorithm implementations

In The Future -

Steps to follow for contribution

1. Fork the repo

Get your own fork/copy of algorithms by using the Fork button on github for the repository

2. Create a local clone of your fork

Clone (download) it to local machine using the command shown below. Replace with your GitHub username instead of YOUR-USERNAME.

$ git clone https://github.com/YOUR-USERNAME/algorithms.git

This will create a local copy of the repository in your machine.

After you have cloned the algorithms repository in Github, move to that folder first using change directory command

# This will change directory to a folder algorithms
$ cd algorithms

Rest of the commands are in this algorithms directory

3. Check configured remote repo for your local copy

You'll see the current configured remote repository for your fork with this command [your local copy has a reference to your forked remote repository in Github ] -

$ git remote -v
origin  https://github.com/YOUR-USERNAME/algorithms.git (fetch)
origin  https://github.com/YOUR-USERNAME/algorithms.git (push)

4. Set up the upstream repo

Add a reference to the original algorithms repository using the following command

$ git remote add upstream https://github.com/vidyabhandary/algorithms.git

This adds a new remote named upstream.

5. Check the remote and local repos

Use the following command to check all the remotes

$ git remote -v
origin    https://github.com/Your_Username/algorithms.git (fetch)
origin    https://github.com/Your_Username/algorithms.git (push)
upstream  https://github.com/vidyabhandary/algorithms.git (fetch)
upstream  https://github.com/vidyabhandary/algorithms.git (push)

6. Sync

Always keep your local copy of repository updated with the original repository. Before making any changes and/or in an appropriate interval, run the following commands carefully to update your local repository.

# Fetch all remote repositories and delete any deleted remote branches
$ git fetch --all --prune

# Switch to `master` branch
$ git checkout master

# Reset local `master` branch to match `upstream` repository's `master` branch
$ git reset --hard upstream/master

# Push changes to your forked `algorithms` repo
$ git push origin master

To add a feature / algorithm

7. Create a new branch

When you want to make a contribution, create a seperate branch using the following command and keep your master branch clean (i.e. synced with remote branch).

# It will create a new branch with name Branch_Name and switch to branch Folder_Name
$ git checkout -b Folder_Name

Create a seperate branch for contibution and try to use same name of branch as of folder.

To switch to desired branch

# To switch from one folder to other
$ git checkout Folder_Name

To add the changes to the branch. Use

# To add all files to branch Folder_Name
$ git add .

Type in a message relevant for the code reveiwer using

# This message get associated with all files you have changed
$ git commit -m 'relevant message'

Now, push your work to your remote repository using

# To push your work to your remote repository
$ git push -u origin Folder_Name

Finally, go to your repository in browser and click on compare and pull requests. Add a title and description to your pull request that explains your effort.

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.