Code Monkey home page Code Monkey logo

first-bit's Introduction

Open Source Love License: MIT GH Pages Merge Bot


first-bit

It's hard. It's always hard the first time you do something. Especially when you are collaborating, making mistakes isn't a comfortable thing. We at BitByte - The Programming Club wanted to simplify the way new open-source contributors learn & contribute for the first time.

Reading articles & watching tutorials can help, but what's better than actually doing the stuff in a practice environment? So, to provide guidance and simplify the way beginners make their first contribution, we've created this amazing project.

If you are a beginner and wants to get your hands dirty in Open Source, you've hopped on to the right place. This project is made just for you.

About first-bit

This project is developed and maintained by BitByte - The Programming Club to help young developers kickstart their journey to the world of Open Source. This is a very basic project where you can easily make your first contribution and learn the complete workflow of using Git and Github along the way.

So, let's start with the first and the most basic step, installing Git.


Install Git

If you don't have git on your machine, install it.

Configure Git

So by now you must have successfully downloaded and installed Git on your system. Congrats! ๐ŸŽ‰ You have completed your first and the most basic step into Open Source.

Now, it's time to let Git know who you really are, i.e., provide your Name and Email Address to Git. This step is important because Git attaches your identity with every commit you make (we'll talk about that later); so that if someone comes around asking, Hey! Who made these changes? or Hey! Who wrote this beautiful code?, Git can instantly say, oh it was this guy or that lady.

To set your username and email in Git, open your Terminal (on Linux, press Ctrl + Alt + t) or Command Prompt (on Windows, press Windows + r to open the Run box, type cmd there and hit Enter) and type the following commands:

git config --global user.name "your-full-name"
git config --global user.email "[email protected]"

replacing your-full-name with your Full Name and [email protected] with your email address (associated with your GitHub account).

Done that? Well, congrats again!! ๐ŸŽ‰ Now, you're all set to start using Git on your system and make wonderful Open Source contributions. ๐Ÿ™Œ


Fork this repository

So, you've come this far. That means you're dedicated enough to make your first contribution to this repository. Amazing! ๐Ÿ˜

So, let's start by forking this repository. But, what exactly is forking, you'd ask! Well, as you don't own this repository, you cannot make any changes directly into it. Anyways, it would cause a disaster if anyone could make any changes into it, wouldn't it? Like assume, some notorious person comes and deletes this whole repository! What would we do then? "Restore the repository", you'd say, but why should we go through all this trouble? ๐Ÿ’

fork this repository

So, how would you make changes to this repository then? Well, that's where forking comes in. Forking this repository will create an exact copy of this repository in your account. And guess what, you can make any changes in that copy and send a Pull Request (we'll talk about that later) to us when you're done with making changes asking us to merge those changes into our main repository. Isn't that amazing? ๐Ÿ˜€

So, what are you waiting for? Go ahead and fork this repository by clicking on the Fork button on the top of this page.


Clone the repository

clone this repository

Now clone the forked repository to your machine. Go to your GitHub account, open the forked repository, click on the clone button and then click the copy to clipboard icon.

Open a terminal and run the following git command:

git clone "url you just copied"

where "url you just copied" (without the quotation marks) is the url to this repository (your fork of this project). See the previous steps to obtain the url.

copy URL to clipboard

For example:

git clone https://github.com/this-is-you/first-bit.git

where this-is-you is your GitHub username. Here you're copying the contents of the first-bit repository on GitHub to your computer.


Create a branch

Change to the repository directory on your computer (if you are not already there):

cd first-bit

Now create a branch using the git checkout command:

git checkout -b <add-your-new-branch-name>

For example:

git checkout -b add-alonzo-church

(The name of the branch does not need to have the word add in it, but it's a reasonable thing to include because the purpose of this branch is to add your name to a list.)


Make necessary changes

For Linux Users

  • On your terminal, change directory (cd) to public/directory (it's where you'll need to add a new file).

    cd public/directory
    
  • Copy the template (name.json.example) in a new file with name this-is-you.json where this-is-you is your GitHub username.

    cp name.json.example this-is-you.json

    (Don't forget to replace this-is-you with your GitHub username above)

  • Open your newly created file with gedit editor to make necessary changes.

    gedit this-is-you.json
  • In the file you just opened, replace this-is-you with your GitHub username, your-name with your Full Name and update the text in bio.

  • Save the file by pressing Ctrl + s and then close the editor.

Congrats! ๐Ÿ™Œ You've now made all the necessary changes required for you to contribute to this repository and get yourself featured on the first-bit website ๐ŸŽ‰ ๐ŸŽ‰. Now, hop on to Before you commit section to see how to check if your changes are going to be valid or not.

For macOS Users

  • On your terminal, change directory (cd) to public/directory (it's where you'll need to add a new file).

    cd public/directory
    
  • Copy the template (name.json.example) in a new file with name this-is-you.json where this-is-you is your GitHub username.

    cp ./name.json.example ./this-is-you.json
    

    (Don't forget to replace this-is-you with your GitHub username above)

  • Open your newly created file with nano editor to make necessary changes.

    nano ./this-is-you.json
    
  • In the file you just opened, replace this-is-you with your GitHub username, your-name with your Full Name and update the text in bio.

  • Save the file by pressing Command + O and then close the editor by pressing Command + X.

Congrats! ๐Ÿ™Œ You've now made all the necessary changes required for you to contribute to this repository and get yourself featured on the first-bit website ๐ŸŽ‰ ๐ŸŽ‰. Now, hop on to Before you commit section to see how to check if your changes are going to be valid or not.

For Windows Users

Using Command Prompt

  • On your command prompt (cmd), change directory (cd) to public/directory (it's where you'll need to add a new file).

    cd public/directory
    
  • Now, type notepad this-is-you.json in your command prompt (replace this-is-you with your GitHub username) and hit Enter. This will search for a file with name this-is-you.json in your current directory.

  • If a file with the same name exists in your current directory (which will not be the case unless you create one), it will be opened using notepad.

  • If not (which is our case ๐Ÿ˜‰), Windows will display a prompt saying Do you want to create a new file?.

  • On clicking Yes, a file with name this-is-you.json will be created in your current directory ๐ŸŽ‰ and opened using notepad.

  • Now copy the following text and paste it in your newly created file:

      {
          "githubId": "this-is-you",
          "name": "your-name",
          "bio": "Something about yourself using not more than 64 characters." 
      }
    

    replacing this-is-you with your GitHub username, your-name with your Full Name and updating the text in bio.

    For example:

      {
          "githubId": "sdhiman99",
          "name": "Shivansh Dhiman",
          "bio": "Searching new horizons.."
      }
    
  • Save the file by pressing Ctrl + s and close the notepad.

Congrats! ๐Ÿ™Œ You've now made all the necessary changes required for you to contribute to this repository and get yourself featured on the first-bit website ๐ŸŽ‰ ๐ŸŽ‰. Now, hop on to Before you commit section to see how to check if your changes are going to be valid or not.

Using GUI

  • Open your file explorer and navigate to the directory where you cloned your forked repository. (You can check the address where you cloned the repository by typing pwd in your command prompt).
  • Navigate to public/directory from there.
  • Create a new file with name <this-is-you>.json where this-is-you is your GitHub username and json is the file extension.
  • Open name.json.example file using your favourite text editor, copy its content and then close it.
  • Open the newly created file using your favourite text editor and paste the content you just copied.
  • Replace this-is-you with your GitHub username, your-name with your Full Name and update the text in bio in the content you just pasted.
  • Save the file by pressing Ctrl + s and close the text editor.

Congrats! ๐Ÿ™Œ You've now made all the necessary changes required for you to contribute to this repository and get yourself featured on the first-bit website ๐ŸŽ‰ ๐ŸŽ‰.

One last thing you need to do before moving on to the next step is to change directory (cd) to public/directory on your command prompt, where you've just created your new file.

cd public/directory

Now, hop on to Before you commit section to see how to check if your changes are going to be valid or not.

Before you commit

You need to make sure that details in json file are correct so that when you open a Pull Request, it would be accepted. This would save last minute hassles.

github username

  • the githubId key in the json (where the alias is this-is-you) is your GitHub Username, not your name.

You can get you GitHub username in many ways. The best way would be to click on the upper right corner of Github website where your avatar is, and open your profile and then the string below your name is your username. In your profile url (something like https://www.github.com/user), the string user would be your username. Watch this gif, if you still don't get it. The selected text in the gif is the username for you.

  • write your bio describing yourself briefly, the default bio is just given as a reference (don't use it).

Now, hop on to Commit your changes section to create a new version of this repository out of the changes made by you (isn't that amazing ๐Ÿ˜) and then make those changes live.


Commit your changes

So now, let's take a look at what files you have added or modified.

git status

To do that, go ahead and execute git status in your terminal or command prompt. You must get an output something like that shown in the attached screenshot.

See that your changes are currently untracked. Which means that Git is not currently tracking the changes in that file. This always happens when you create a new file.

Go ahead and add your file to the staging area so that your new file can be tracked and is ready to be committed.

git add this-is-you.json

git status

Execute git status again to check that your changes are in the staging area and thus, ready to be committed.

Now commit those changes using the git commit command:

git commit -m "Add this-is-you.json"

where Add this-is-you.json is the small message you are attaching with your commit.

Congrats!! Your changes are successfully committed now and you've made a new version out of your changes. ๐ŸŽ‰ ๐ŸŽ‰


Push changes to GitHub

Now you need to push (upload) your new version of the project to your forked copy of the original project on GitHub. Remember, you cannot directly push to the original project as you don't have the permission to make any changes there (that's the reason you forked the project in the first place).

Push your changes to GitHub using the command git push:

git push origin <add-your-branch-name>

replacing <add-your-branch-name> with the name of the branch you created earlier (branch on which your new changes reside).

Hooray!! You've successfully pushed your changes to GitHub. ๐Ÿš€


Submit your changes for review

Now, it's time to create a Pull Request.

Pull Request is a way to request the maintainers of the original repository of the project, to merge your changes into their main project and make them live. ๐Ÿš€

If they like your changes, they'll merge them otherwise they'll send you a detailed review on, at what places you need to make changes for them to be able to merge your code.

To create a Pull Request, you go to your forked repository on GitHub, you'll see a Compare & pull request button, as shown in the screenshot[1]. Click on that button.

create a pull request

If you don't see the above button, don't worry! Everything is fine. The button automatically disappears after some time.

  • To create a Pull Request in this case, click on the dropdown menu, as shown in the screenshot[2].
  • From there, select the branch on which you made your changes.
  • Then, click on the Pull Request link, as shown in the screenshot[3].

And you are good to go.

Now, write the short title of your PR along with a small description of what changes you made in this PR. It helps reviewers to easily review your work and give you the feedback more quickly.

Now, submit the pull request and wait for reviewers to review your work and give you appropriate feedback.

submit pull request

Yayyyy!!! ๐ŸŽ‰ ๐ŸŽ‰ You have successfully completed all the necessary steps to make your first contribution to Open Source. A huge congratulations to you.

For this repository,

  • If the contribution made by you is good and you pass all tests, github-actions will automatically merge your changes to the main repository.
  • Otherwise, it will show you a โŒ sign against your commit. On clicking on that and then on Details, you may find the error which occurred while testing your changes and then fix that by making the new commit in your branch and pushing your changes again. You don't need to open a Pull Request again, it will automatically append your changes in the existing Pull Request as from one branch, only one Pull Request can be opened.

Where to go from here?

Congrats! You just completed the standard fork -> clone -> edit -> PR workflow that you'll encounter often as a contributor!

Celebrate your contribution and share it with your friends and followers on Twitter, Facebook and LinkedIn.

Now let's get you started with contributing to other projects. We've compiled a list of resources and projects with easy issues you can get started on. Check out the following links:

first-bit's People

Contributors

akashpaloju avatar aryan0723 avatar ashiaecs avatar augilar avatar avats-dev avatar chamiduu avatar chaudharyraman avatar chiragsharma1 avatar deven-533 avatar ex2uply avatar famosi avatar garg3133 avatar github-actions[bot] avatar hritikcfc24 avatar ishaan28malik avatar janglee123 avatar kanishka8276 avatar kofosu2289 avatar mridulrb avatar nunia avatar phroggdev avatar rush1kesh-010 avatar rushil-ambastha avatar samishtha20 avatar shivarajloni avatar theanmolsharma avatar tushhr avatar vijayjatin7 avatar wisetok12680 avatar zubair-12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

first-bit's Issues

gh-pages deployment action failing

Since some time (to be exact, since last two merges), automatic deployment of gh-pages is failing.

The error from logs look like this:

yarn run v1.22.5
$ vue-cli-service build
-  Building for production...

 ERROR  Failed to compile with 1 errors12:31:11 PM

This relative module was not found:

* ../../public/nameDB.json in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Grid.vue?vue&type=script&lang=js&
 ERROR  Build failed with errors.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
##[error]Process completed with exit code 1.

Possible reasons:

  • outdated package or any compatibility issues
  • not considering case sensitive package names

Possible Resolution

I don't know much but what I found is that following methods might solve this (not sure):
Reference : vuejs/vue-cli#439

rm -rf node_modules
npm install

or

npm i -g npm-check-updates
npm-check-updates -u
npm install

These might help resolve package issues if there would be any.
Also @Janglee123 why are we not using npm instead of yarn?

HACKTOBERFEST 2020

Hacktoberfest 2020

Hacktoberfest 2020 ๐ŸŽ‰

So, the festive season for OPEN SOURCE is back guys and we are here to help you contribute (and grab the swags ๐Ÿ”ฅ ๐ŸŽ‰ ).

๐Ÿ—ฃ Hacktoberfest encourages participation in the open source community, which grows bigger every year. Hacktoberfest is a good way to start your journey into open source.

As per the ethics of first-bit, you have to abide by just one RULE:

  • This project is for contributors who have never contributed before or are still starting out in Open Source. This project is committed to help first timers get started (not for people finding ways to complete their 4 PRs as formality), and people contributing should respect this commitment while they're here. Thanks.

๐Ÿ“ข Register here for Hacktoberfest.



GOAL

To help you contribute to OPEN SOURCE REALM.

WHAT YOU NEED TO DO

  • Go and open README.
  • Follow the steps there ๐Ÿš€ ๐ŸŽ‰.


Hacktoberfest2020


GitHub Security Lab (GHSL) Vulnerability Report: `GHSL-2020-313`

We have been unsuccessfully trying to contact the repository owners since 2020-11-30.
The issue affects master, Janglee123-patch-2, Janglee123-patch-1 and revert-83-master branches.

Summary

The auto_merge.yml GitHub workflow is vulnerable to unauthorized modification of the base repository or secrets exfiltration from a Pull Request.

Tested Version

The latest changeset a43fb3c to the date.

Details

Issue: Untrusted code is explicitly checked out and run on a Pull Request from a fork

pull_request_target was introduced to allow triggered workflows to comment on PRs, label them, assign people, etc.. In order to make it possible the triggered action runner has read/write token for the base repository and the access to secrets. In order to prevent untrusted code from execution it runs in a context of the base repository.

By explicitly checking out and running build script from a fork the untrusted code is running in an environment that is able to push to the base repository and to access secrets.

on:
  pull_request_target:
    paths:
    - 'public/directory/**.json'
...
      uses: actions/checkout@v2
      with:
        ref: ${{github.event.pull_request.head.ref}}
        repository: ${{github.event.pull_request.head.repo.full_name}}
    
    - name: Yarn install
      uses: actions/setup-node@v1
    - run: yarn install

Impact

The vulnerability allows for unauthorized modification of the base repository and secrets exfiltration.

Remediation

Use pull_request trigger that doesn't have read/write repository token and no access to secrets. If at some point a write access is needed split the workflow in two and use workflow_run.

Credit

This issue was discovered and reported by GHSL team member @JarLob (Jaroslav Lobaฤevski).

Contact

You can contact the GHSL team at [email protected], please include a reference to GHSL-2020-313 in any communication regarding this issue.

Disclosure Policy

This report is subject to our coordinated disclosure policy.

Public opinion on PR template

I'm thinking about adding a PR template along with issue templates. As this repo is focused on helping newcomers, I've also mentioned how this could help them.

Issue template (possible options):

  • report bugs (well there always could be something crawling)
  • feature request (it is what is says)
  • newcomer (for newcomers, and people should open this issue first and then open a PR linking back to this issue)

PR template (there is generally just one):

  • Along with forking, cloning and adding commits and then opening a PR, people would know describing a PR and linking back to a issue.
  • For newcomers this PR should link back to the newcomer issue that they've opened.

Advantages:

  • people with get familiar with reporting issues and describing PRs.
  • people also get a hang of markdown, i learned like this ๐Ÿ˜„ .
  • we could give an option to people while opening newcomer issue to opt for a mentor if they're still unsure of what's happening and need help. This will help us in identifying and help them through this.

Drop suggestions and edits, constructive criticism can only help us grow. ๐Ÿš€

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.