From a421758f40e2585293c8e485bd8dbc7ae240de07 Mon Sep 17 00:00:00 2001 From: johnluzada97 Date: Tue, 8 Apr 2025 14:42:28 -0400 Subject: [PATCH 1/5] testing file upload --- new-file.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 new-file.py diff --git a/new-file.py b/new-file.py new file mode 100644 index 0000000..8e23576 --- /dev/null +++ b/new-file.py @@ -0,0 +1 @@ +print("Hello World") \ No newline at end of file From 61a5b5d27c988713c985f7219f007f5e1153c6d9 Mon Sep 17 00:00:00 2001 From: johnluzada97 Date: Tue, 8 Apr 2025 14:57:44 -0400 Subject: [PATCH 2/5] Modified the README file to make it more personal --- README.md | 91 +++++++++++++++++++++---------------------------------- 1 file changed, 35 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 35f42e7..f753252 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ --- + @@ -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: @@ -39,26 +39,23 @@ 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: @@ -66,35 +63,32 @@ 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@example.com" 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@example.com" - ``` - 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@example.com" + ``` + 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 git@github.com`. 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). @@ -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)
- ## 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. @@ -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 @@ -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/) @@ -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 From 6a6d910b1c67ef9504452fd0efcc13a637bce511 Mon Sep 17 00:00:00 2001 From: johnluzada97 Date: Tue, 8 Apr 2025 15:18:28 -0400 Subject: [PATCH 3/5] added for loop to new-file.py --- new-file.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/new-file.py b/new-file.py index 8e23576..ae151c8 100644 --- a/new-file.py +++ b/new-file.py @@ -1 +1,7 @@ -print("Hello World") \ No newline at end of file +print("Hello World") + + + +for i in range(5): + m = i**i + print(m) \ No newline at end of file From a996723e564e0ca80115de62bb24b406d6e29cc6 Mon Sep 17 00:00:00 2001 From: johnluzada97 Date: Tue, 8 Apr 2025 16:06:51 -0400 Subject: [PATCH 4/5] Im not sure what this is --- new-file.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/new-file.py b/new-file.py index ae151c8..248ee3a 100644 --- a/new-file.py +++ b/new-file.py @@ -4,4 +4,5 @@ for i in range(5): m = i**i - print(m) \ No newline at end of file + + print(m + "hello") \ No newline at end of file From 3b0669919c8942a40d2bdec481e6522b9d17337b Mon Sep 17 00:00:00 2001 From: johnluzada97 Date: Tue, 8 Apr 2025 16:36:40 -0400 Subject: [PATCH 5/5] put a dataframe in the new-file --- new-file.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/new-file.py b/new-file.py index 248ee3a..39a3c14 100644 --- a/new-file.py +++ b/new-file.py @@ -5,4 +5,14 @@ for i in range(5): m = i**i - print(m + "hello") \ No newline at end of file + 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) \ No newline at end of file