Skip to content

testing file upload #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
91 changes: 35 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
</h3>

---

<!--
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://jarednielsen.com/learn-git-fork-pull-request/)
-->
Expand All @@ -20,16 +21,15 @@ This tutorial aims to provide an in-depth introduction to version control system

We will use the ⌨️ Command Line Interface (CLI) (i.e. `Bash` for Windows and `Terminal` in MacOS) to perform essential command line techniques. In case you want to learn how to use `git` with [GitHub Desktop](https://desktop.github.com/), please refer to the slides available [here](https://javedali99.github.io/git-tutorial/slides.html).


## Git: An Overview

`Git` is a free and open-source version control software that was created by Linus Torvalds, the creator of Linux. It helps software developers track changes made to their code over time, making it easier to collaborate with others and revert changes when necessary.

All files in a project directory, or a `repository` (repo for short), are tracked by a hidden `.git` file located in the root directory. You can create a new repository on your local machine by navigating to the directory where you want your project to live and typing the `git init` command.
All files in a project directory, or a `repository` (repo for short), are tracked by a hidden `.git` file located in the root directory. You can create a new repository on your local machine by navigating to the directory where you want your project to live and typing the `git init` command.

Git allows you to roll back to a previous snapshot of your project called a `commit`. When you want to take a snapshot of your work, you'll need to `add` the changes to your files to a **staging area**. You can think of a staging area (literally) like a staging area. The changes that you want to be included in your next snapshot need to be put on stage in order to be captured by the `commit`.
Git allows you to roll back to a previous snapshot of your project called a `commit`. When you want to take a snapshot of your work, you'll need to `add` the changes to your files to a **staging area**. You can think of a staging area (literally) like a staging area. The changes that you want to be included in your next snapshot need to be put on stage in order to be captured by the `commit`.

Each commit requires a message to describe what has changed. These commit messages should be brief but descriptive, allowing you (or others) to understand what has changed without having to read the code.
Each commit requires a message to describe what has changed. These commit messages should be brief but descriptive, allowing you (or others) to understand what has changed without having to read the code.

Here is a visual representation of the process:

Expand All @@ -39,62 +39,56 @@ Here is a visual representation of the process:

Let's delve into some common `git` commands. This is not a complete list — for a more comprehensive look at the `git` commands, check the [official Git documentation](https://git-scm.com/docs):


| Command | Description |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `git init` | Initializes a new Git repository in the current directory. This creates a hidden `.git` directory which is used to track changes. This command is typically only used once at the start of a project. |
| `git status` | Provides information about any untracked files, changes not yet staged for commit, and changes that are staged but not yet committed. This command helps you understand the state of your project at any given time. |
| `git add FILE-NAME` or `git add .` | The `git add` command adds a file or all files (`.`) to the staging area. This signals to Git that these changes should be included in the next commit. |
| Command | Description |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `git init` | Initializes a new Git repository in the current directory. This creates a hidden `.git` directory which is used to track changes. This command is typically only used once at the start of a project. |
| `git status` | Provides information about any untracked files, changes not yet staged for commit, and changes that are staged but not yet committed. This command helps you understand the state of your project at any given time. |
| `git add FILE-NAME` or `git add .` | The `git add` command adds a file or all files (`.`) to the staging area. This signals to Git that these changes should be included in the next commit. |
| `git commit -m "Description"` | This command takes a snapshot of all changes in the staging area and saves them as a new commit in the repository. The `-m` flag is followed by a message that should briefly describe the changes made in this commit. |

The process described above happens on your local machine. This is perfect for solo projects, but if you want to collaborate with others or create a backup of your code, you'll need to use **GitHub**.

## GitHub: An Overview

GitHub is a platform that allows developers to host and share their Git repositories online. It's a fantastic tool for collaboration, allowing multiple developers to work on the same project simultaneously without overwriting each other's changes. It's also a great way to backup your code — should your local machine ever fail, you can simply clone your repository from GitHub and continue where you left off. In addition to providing a great UI on top of a server that hosts your repositories, GitHub has a number of additional features such as issue tracking, wiki pages, and notifications that make it a great collaboration tool.
GitHub is a platform that allows developers to host and share their Git repositories online. It's a fantastic tool for collaboration, allowing multiple developers to work on the same project simultaneously without overwriting each other's changes. It's also a great way to backup your code — should your local machine ever fail, you can simply clone your repository from GitHub and continue where you left off. In addition to providing a great UI on top of a server that hosts your repositories, GitHub has a number of additional features such as issue tracking, wiki pages, and notifications that make it a great collaboration tool.

GitHub repositories are just like Git repositories, but with some added features. For example, GitHub allows for `pull requests`, where one developer can propose changes to a project that another developer can review and approve. GitHub also includes tools for project management, such as issue tracking and project boards.

One key thing to remember is that GitHub doesn't just store a copy of your code files — it stores the **entire history** of changes to the files, thanks to Git. This allows other developers to view the files at an earlier point in time, or even revert the entire project back to an earlier state.



## To Get Started with Git and GitHub

Here's a step-by-step guide to get you started with Git and GitHub:

1. **Create a GitHub Account**: Visit [github.com](https://github.com/) and register for an account.

2. **Install Git**: Depending on your operating system, download and install Git using one of the following methods:
- Windows users: Download and install [Git for Windows](https://gitforwindows.org/).
- Mac users: Download and install [Git for MacOS](https://git-scm.com/download/mac) or use Homebrew by typing `brew install git` in the Terminal.

- Windows users: Download and install [Git for Windows](https://gitforwindows.org/).
- Mac users: Download and install [Git for MacOS](https://git-scm.com/download/mac) or use Homebrew by typing `brew install git` in the Terminal.

3. **Configure Git**: Once Git is installed, you'll need to configure it with your name and email address. This information is used to track who made each commit in a project. Open your Terminal or Command Prompt and type the following commands, replacing "FirstName LastName" and "[email protected]" with your name and email:

```bash
# Enter YOUR NAME to set your name
git config --global user.name "FirstName LastName"
```bash
# Enter YOUR NAME to set your name
git config --global user.name "FirstName LastName"

# Enter YOUR EMAIL to set your email. Make sure it is the email associated with your GitHub account!
git config --global user.email "[email protected]"
```
You can verify that the configuration worked by typing `git config --list`. The output should include your name and email. Ensure you use the email associated with your GitHub account. This is important because Git will use this information when you work on a project.
# Enter YOUR EMAIL to set your email. Make sure it is the email associated with your GitHub account!
git config --global user.email "[email protected]"
```

You can verify that the configuration worked by typing `git config --list`. The output should include your name and email. Ensure you use the email associated with your GitHub account. This is important because Git will use this information when you work on a project.

> See [this article](https://help.github.com/articles/set-up-git/) for more information on setting up GitHub.

4. **Set up SSH Keys**: SSH (Secure Shell) keys are a way to identify yourself to GitHub without needing to provide your username and password every time. They are a pair of encryption keys that work together to secure your connection. The public key is stored on GitHub and the private key is stored on your local machine.
4. **Set up SSH Keys**: SSH (Secure Shell) keys are a way to identify yourself to GitHub without needing to provide your username and password every time. They are a pair of encryption keys that work together to secure your connection. The public key is stored on GitHub and the private key is stored on your local machine.

Here are the steps to generate a new SSH key and add it to your GitHub account:
Here are the steps to generate a new SSH key and add it to your GitHub account:

- **Check for existing SSH keys:** Open your Terminal or Command Prompt and type `ls -al ~/.ssh`. If you see files named `id_rsa.pub` or `id_ed25519.pub`, you already have an SSH key. If not, you'll need to create one.

- **Generate a new SSH key:** In your Terminal or Command Prompt, type `ssh-keygen -t ed25519 -C "your email address"`, replacing "your email address" with the email you used to sign up for GitHub. Press `Enter` to accept the default file location. When asked to enter a passphrase, either type a secure passphrase or press `Enter` to proceed without a passphrase.

- **Add your SSH key to the ssh-agent:** First, start the ssh-agent in the background by typing `eval "$(ssh-agent -s)"`. Then, add your SSH private key to the ssh-agent by typing `ssh-add ~/.ssh/id_ed25519` (or `ssh-add ~/.ssh/id_rsa` if you're using an RSA key).

- **Add your SSH key to your GitHub account:** Type `cat ~/.ssh/id_ed25519.pub` (or `cat ~/.ssh/id_rsa.pub` for RSA keys) and press `Enter` to display your public key. Select and copy the key. Then, go to the GitHub website, click your profile photo, select **Settings**, then **SSH and GPG keys**, then **New SSH key**. Paste your key into the "Key" field and click **Add SSH key**.

- **Test your SSH connection:** Go back to your Terminal or Command Prompt and type `ssh -T [email protected]`. If you see a message saying `"You've successfully authenticated, but GitHub does not provide shell access"`, then everything is working!

> For more information on SSH keys, check out the [GitHub guide for SSH keys](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) or the [Software Carpentry guide](https://swcarpentry.github.io/git-novice/07-github/index.html#3-ssh-background-and-setup).
Expand All @@ -107,13 +101,12 @@ Here is _one_ example of a workflow you may choose when working on a project. Le
![clone button on GitHub](imgs/clone.png)
-->

Then, on your terminal, you could use the `git clone` command described below. Here is a diagram of the full process:
Then, on your terminal, you could use the `git clone` command described below. Here is a diagram of the full process:

![git with github diagram](imgs/full-git-process.png)

<br>


## Collaborating with Git and GitHub

Now that we've covered the basics of Git and GitHub, let's take a look at how they can be used for collaboration.
Expand All @@ -130,55 +123,41 @@ Finally, to propose that your changes be merged into the original project, you c

Here are some additional `git` commands that allow you to interact easily with GitHub:

| Command | Description |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `git clone REPO-URL` | Creates a new copy of a source repository, usually hosted on a remote server. Use this when you want to clone a GitHub repository. This command creates a new subdirectory named after the source repository. |
| `git push origin main` | Pushes all commits on the `main` branch made since the last push to another repository (`origin`), typically across the network (e.g., to GitHub). |
| `git pull` | Pulls all commits made since the last pull from another repository, and attempts to merge those changes into your current files. This is useful when collaborating with others, as it allows you to incorporate their changes into your project. |
| `git config` | Configure your GitHub account. You should run `git config --global user.name "Your Full Name"` and `git config --global user.email your-github-email` to initially set up. |



| Command | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `git clone REPO-URL` | Creates a new copy of a source repository, usually hosted on a remote server. Use this when you want to clone a GitHub repository. This command creates a new subdirectory named after the source repository. |
| `git push origin main` | Pushes all commits on the `main` branch made since the last push to another repository (`origin`), typically across the network (e.g., to GitHub). |
| `git pull` | Pulls all commits made since the last pull from another repository, and attempts to merge those changes into your current files. This is useful when collaborating with others, as it allows you to incorporate their changes into your project. |
| `git config` | Configure your GitHub account. You should run `git config --global user.name "Your Full Name"` and `git config --global user.email your-github-email` to initially set up. |

## 🖥️ Git Commands Cheat Sheet

**Set configuration values for your username and email**
**Set configuration values for your username and email**

```bash
git config --global user.name YOUR NAME
git config --global user.email YOUR EMAIL
```



**Set default branch to main**

```bash
git config --global init.default branch main
```



**Get help on a command**




```bash
git help COMMAND
git COMMAND -h
```



**Initialize a new git repository**

```bash
git init
```



**Clone a repository**

```bash
Expand Down Expand Up @@ -295,8 +274,6 @@ git push (REMOTE) (BRANCH)
git pull REMOTE
```



## 📚 RESOURCES

- Official Git web site: [https://www.git-scm.com/](https://www.git-scm.com/)
Expand All @@ -309,10 +286,12 @@ git pull REMOTE

- Git Overview Book: [http://git-scm.com/book/en/v2](http://git-scm.com/book/en/v2)

- Sample ignore files: [https://github.com/github/gitignore](https://github.com/github/gitignore)
- Sample ignore files: [https://github.com/github/gitignore](https://github.com/github/gitignore)

- How can I learn more about Markdown languages?

- [Here is a great Markdown tutorial](https://commonmark.org/help/tutorial/)

- [Here is a quick Markdown guide](https://www.markdownguide.org/basic-syntax/)

Hey I just want to see what would happen if I were to add this to the readme file and try push it to the main repository
18 changes: 18 additions & 0 deletions new-file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
print("Hello World")



for i in range(5):
m = i**i

print(m)


import pandas as pd

dataframe_a = { 'A' : [1, 2, 3, 4, 5, 6, 7] , 'B' : [1, 2, 3, 4, 5, 6, 7], 'C' : [1, 2, 3, 4, 5, 6, 7], 'D' : [1, 2, 3, 4, 5, 6, 7] }


df = pd.DataFrame(dataframe_a)

print(df)
4 changes: 4 additions & 0 deletions test-file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This is the content in my text file I am hoping it creates a merge conflict

This would work right
This is the content in my text file I am hofgng it creates a merge conflict
3 changes: 3 additions & 0 deletions testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
_Italics_

**This is bold**