Skip to content

Commit

Permalink
add quick introduction to github cmd line usage #4
Browse files Browse the repository at this point in the history
  • Loading branch information
SaicharanKandukuri committed Sep 3, 2022
1 parent f992631 commit 6e63204
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,83 @@
# Hi there πŸ‘‹
Thanks for taking the time to contribute to this org! πŸŽ‰. this page helps you get started with contributing to this org. πŸš€

## Table of Contents
- [Hi there πŸ‘‹](#hi-there-)
- [Table of Contents](#table-of-contents)
- [Quick intro with `git`](#quick-intro-with-git)
- [Cloning a repository](#cloning-a-repository)
- [Initializing repository](#initializing-repository)
- [Submitting changes](#submitting-changes)

<hr/>

## Quick intro with `git`
Here is a quick intro for github users who are not familiar with git.

### Cloning a repository
To clone a repository, you need to copy the url of the repository and then run the following command:
```bash
git clone <link>
```

> replace `<link>` with the url of the repository
### Initializing repository
to initialize a folder or a workspace as a git repository, you can use the following command:
```bash
git init
```

> Make sure you are in the right folder before running this command.
> Only used when creating **new** repository
### Submitting changes
after making changes to file you can use this set this commands to push chages to GitHub server.

```bash
git pull -v
git add -A
git commit -v -m "Changes to repo"
git push
```

<details>
<summary> Code Explanation </summary>

Here is a quick explanation of above commands

```bash
git pull -v
```

this option will `pull` the latest changes from the server and merge them with your local changes.

and option `-v` is optional and it will show you the changes that are being pulled.

```bash
git add -A
```

`add` option will add all the changes to the staging area and option `-A` is set to add all the changes.

```bash
git commit -v -m "Changes to repo"
```

`commit` option will commit the changes to the local repository and option `-v` is optional and it will show you the changes that are being committed.

and option `-m` is used to add a message to the commit.

> messages are important to a commit cause it explains what changes are being made.
```bash
git push
```

`push` option will push the changes to the github server.

</details>

> refer [GitHub HelloWorld docs](https://docs.github.com/en/get-started/quickstart/hello-world) for a quick intro with github web

0 comments on commit 6e63204

Please sign in to comment.