Skip to content

Commit

Permalink
Added Source Code of Git & GitHub Video Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhish7k committed Oct 1, 2023
1 parent d298cc7 commit 568572c
Show file tree
Hide file tree
Showing 2 changed files with 5,637 additions and 0 deletions.
156 changes: 156 additions & 0 deletions content/batch/learn/github/intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,162 @@ Want to improve this page?. Raise a issue on [@github](https://github.com/Manish
👨‍💻📝 Now that you have completed the JavaScript tutorial video and reviewed the JavaScript cheat sheet, it's time to put your knowledge into practice by completing the JavaScript assignments. 🚀
</Callout>


## Notes

### Configure Git settings.

```bash
git config
```

### Set name.

```bash
# Set your name for Git.
git config --global user.name "Your Name"
```

### Set email.

```bash
# Set your email for Git.
git config --global user.email "[email protected]"
```

### Enable color.

```bash
# Enable color output.
git config --global color.ui true
```

### Initialize a repository.

```bash
# Initialize a new Git repository.
git init
```

### Clone a repository.

```bash
# Clone an existing repository to your local machine.[either using https or SSH(when you have linked github with your computer using SSH keys) link]
git clone <repository url>
```

### Show status.

```bash
# Show the status of your working directory and staging area.
git status
```

### Add file.

```bash
# Add a file to the staging area.
git add <file>
```

### Commit changes.

```bash
# Commit changes in the staging area with a message.
git commit -m "Commit message"
```

### Show branches.

```bash
# Show a list of all branches in the repository.[your current working branch will be green coloured with * mark before it].
git branch
```

### Create new branch.

```bash
# Create a new branch with the given name.
git branch <branch name>
```

### Switch branch.

```bash
# Switch to the branch with the given name.
git checkout <branch name>
```

### Merge changes.

```bash
# Merge changes from the specified branch into the current branch.
git merge <branch name>
```

### Show remote repositories.

```bash
# Show a list of all remote repositories.
git remote -v
```

### Add remote repository.

```bash
# Add a new remote repository.
git remote add <remote name> <remote url>
```

### Push changes.

```bash
# Push changes to the remote repository.
git push <remote name> <branch name>
```

### Pull changes.

```bash
# Pull changes from the remote repository.
git pull <remote name> <branch name>
```

### Show log.

```bash
# Show a log of all commits in the repository.
git log
```

### Show diff.

```bash
# Show a diff of all changes made since the last commit.
git diff
```

### Stash.

```bash
# Temporarily save changes without committing them.
git stash
```

### Reset.

```bash
# Unstage changes in the staging area.
git reset
```

### Undo changes.

```bash
# Undo changes made in a specific commit.
git revert <commit hash>
```

</TabsContent>

<TabsContent value="assignment">
Expand Down
Loading

0 comments on commit 568572c

Please sign in to comment.