Skip to content

Latest commit

 

History

History
73 lines (54 loc) · 3.17 KB

HOWTO.md

File metadata and controls

73 lines (54 loc) · 3.17 KB

Welcome to the LeetCode Solution Curation! If you are new to open source contribution and/or if you need a refresher on Git and GitHub basics, here are some resources to help you out:

In case you don't want to go through the resources, here's a quick refresher:

  • Get a copy of leetcode-solution-curation by clicking the Fork button.

  • Clone, i.e, download your copy of the repository to your local machine using

# Creates a folder named `leetcode-solution-curation` in the current directory with appropriate resources
$ git clone https://github.com/[your_username]/leetcode-solution-curation.git
  • Move to the leetcode-solution-curation folder using
# Changes current directory to a folder named `leetcode-solution-curation`
$ cd leetcode-solution-curation
  • Run the following command to see that your local copy has a reference to your forked remote repository in GitHub.
$ git remote -v
origin  https://github.com/[your_username]/leetcode-solution-curation.git (fetch)
origin  https://github.com/[your_username]/leetcode-solution-curation.git (push)
# Adds a new remote named `upstream`
$ git remote add upstream https://github.com/Tahanima/leetcode-solution-curation.git
  • Keep your copy of the repository updated with the original repository. Before making any changes and/or in an appropriate interval, run the following commands to update your local repository.
# Switches to `main` branch
$ git checkout main

# Fetches the branches and their respective commits from the `upstream` repository
$ git fetch upstream

# Merges the changes from upstream/main into your local default branch
$ git merge upstream/main

# Pushes changes to your forked `leetcode-solution-curation` repo
$ git push origin main
  • Run the following commands as needed while working.
# Creates a new branch named `branch_name` and switches to it
$ git checkout -b branch_name

# Switches to an existing branch named `branch_name`
$ git checkout branch_name

# Adds a file with the path `path_to_file` respective to the root directory
$ git add path_to_file

# Associates the message 'relevant message' to the file you have changed
$ git commit -m 'relevant message'

# Pushes your changes to your remote repository
$ git push -u origin branch_name

To sumbit your pull request after pushing changes to a branch, go to the leetcode-solution-curation repository from your browser and click on Compare & pull requests. Add the necessary details and then, submit the pull request.