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
- Visit GitHub and then sign in to your account
Click on the new button to create a new repository in the top left
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 alicense
I am usingMIT
you can choose any one of your choices, the click on thecreate repository
button
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
- click on the
Add file
button followed bycreate new file
- 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 See now we have created a new file having a commit id (commit id is needed to modify or delete a particular commit )
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.& if you Like it feel free to hit a ❤️
Top comments (0)