2

Creating & modifying a repository in GitHub

 2 years ago
source link: https://dev.to/kumarkalyan/creating-modifying-a-repository-in-github-4gle
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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 and then sign in to your account
  2. Click on the new button to create a new repository in the top left

  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

  4. Now we have successfully created a repository

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
  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 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

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

now click on the pencil icon to edit the file
and now add some more content to your file

now again add a commit message and description and hit the commit button

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.

Connect


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK