Creating & modifying a repository in GitHub
Tags: github, webdev, tutorial, githunt
Published: 2021-12-18 16:57:50

Hi everyone I am back with a new article of this series, In the last article I have explained the difference between `git` & `GitHub` but this article will help you to  create a repository in GitHub, all you need for this is just a GitHub account.

#Creating a repository 

1. Visit [GitHub](https://github.com/) and then sign in to your account
2. Click on the new button to create a new repository in the top left
![github new repo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z60qkrq5ca80652gk9h9.png)

3. Then add a repository name (tip: use short meaningful names), then add a description in the description field, then set your repo visibility to public or private, in this case I am setting it to `public`, then add a `license` I am using `MIT` you can choose any one of your choices, the click on the `create repository` button
 ![creating repo ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mxis03ixz2j9z8udtfah.png)
4. Now we have successfully created a repository  
![repo created](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9f15nvvtjey0jiq80itd.png)

#Modifying our repository 

In this article we will create, modify and add files to your repository directly from the GitHub

##creating a file 
Open the repository, that you want to modify or simply visit, `https://github.com/<your username >/<repository name >`, in this case `https://github.com/kum9748ar/github-tutorial`

1. click on the `Add file` button followed by `create new file `
![creating a file ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vykesaa7vflg9ncy7zx7.png)
2. Now add a `file name` and write something in your file, you can click on the preview tag to see how your file looks like, then add a commit message and commit description (why these things are needed? typically, while working in a team or building a project, you show know that what you have committed(added) and why, let's assume that you have designed a calculator app and hosted your code to GitHub, after a few days you have added a new feature to it, so in this case you can add a commit message like "added a new feature " and description like "this feature will help in exponential calculations"  )
now click on the commit new file and this add a new file to your repository 
 ![commiting a file ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ysbvhwihvnfhfce285jl.png)
See now we have created a new file having a commit id (commit id is needed to modify or delete a particular commit )
![file with commit id ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gbsnriege55c5ld4pmyv.png)

##editing a file 
Now let's see that how we can edit our file in GitHub,
Again move back to your GitHub repo and click on `go to file `
![go to file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kvly0rvm3rv3y8fkvftn.png)
 
now click on the pencil icon to edit the file
and now add some more content to your file 
![file edit](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9hg680765si3pbm0z00l.png)
now again add a commit message and description and hit the commit button 
![commited new file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/00pwptzos4skylg8erk1.png)
see we have successfully edited our file with a new commit id 

 

  
 
##Conclusion 
So, guys we have successfully created and modified our repository, feel free to comment you if you have any doubts. In the next article, I will show that how you can push your code or upload files to GitHub Directly from the CLI(Command Line Interfaces), how to revert a commit, branching, pull requests , issues , and  many more Git concepts, so stay tuned for the next one.& if you Like  it feel free to hit a ❤️      
 

##Connect
 <a href="https://linktr.ee/kumarkalyan">
  <img align="left" width="100px" src="https://cdn.jsdelivr.net/npm/simple-icons@v3/icons/twitter.svg" />
</a>