From 79f7157d08f4ee91ae12be4bc498957736656aa0 Mon Sep 17 00:00:00 2001 From: Darshan Thakkar Date: Fri, 7 Mar 2025 11:44:28 -0500 Subject: [PATCH 1/5] Add powershell admin commands --- src/ch2.2-create-github-account.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ch2.2-create-github-account.md b/src/ch2.2-create-github-account.md index 85f6dbc..9a31447 100644 --- a/src/ch2.2-create-github-account.md +++ b/src/ch2.2-create-github-account.md @@ -57,6 +57,16 @@ In Powershell, start the ssh service: Start-Service ssh-agent ``` +If that does not work, open Powershell as Administrtor and run: + +```Powershell +Get-Service ssh-agent | Set-Service -StartupType Manual +Start-Service ssh-agent +Get-Service ssh-agent +``` + +After successful execution, it should say the service is running. + Linux In the terminal, check if the ssh service is running: From f5ee240bb22da21e164fdfd0bdbe3daac71c7e63 Mon Sep 17 00:00:00 2001 From: Darshan Thakkar Date: Fri, 7 Mar 2025 11:47:43 -0500 Subject: [PATCH 2/5] Add windows command for 'cat' --- src/ch2.2-create-github-account.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ch2.2-create-github-account.md b/src/ch2.2-create-github-account.md index 9a31447..5382306 100644 --- a/src/ch2.2-create-github-account.md +++ b/src/ch2.2-create-github-account.md @@ -102,9 +102,11 @@ ssh-add ~/.ssh/id_ed25519 Print the public key content to the terminal and copy it: -```bash -cat ~/.ssh/id_ed25519.pub -``` +Linux: +`cat ~/.ssh/id_ed25519.pub` + +Windows: +`type ~/.ssh/id_ed25519.pub` ## Add the Public Key to your GitHub Account From 536d36f3637ad316bb7a723dfbcc38a588244b76 Mon Sep 17 00:00:00 2001 From: Darshan Thakkar Date: Wed, 24 Sep 2025 17:06:49 -0400 Subject: [PATCH 3/5] Add windows command for ssh-add --- src/ch2.2-create-github-account.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ch2.2-create-github-account.md b/src/ch2.2-create-github-account.md index 5382306..2a37653 100644 --- a/src/ch2.2-create-github-account.md +++ b/src/ch2.2-create-github-account.md @@ -49,7 +49,7 @@ Your repository is now ready! You can start adding files, cloning it to your loc ## Start the SSH Agent Service -Windows +#### Windows In Powershell, start the ssh service: @@ -57,7 +57,7 @@ In Powershell, start the ssh service: Start-Service ssh-agent ``` -If that does not work, open Powershell as Administrtor and run: +If that does not work, open **Powershell as Administator** and run: ```Powershell Get-Service ssh-agent | Set-Service -StartupType Manual @@ -67,7 +67,7 @@ Get-Service ssh-agent After successful execution, it should say the service is running. -Linux +#### Linux In the terminal, check if the ssh service is running: @@ -94,10 +94,16 @@ This creates a pair of keys: Run this command to add the private SSH Key to SSH Agent: +#### Linux ```bash ssh-add ~/.ssh/id_ed25519 ``` +#### Windows +```Powershell +ssh-add "$env:USERPROFILE\.ssh\id_ed25519" +``` + ## Get the Public Key Content Print the public key content to the terminal and copy it: From ec00e88341610597d9da5502e21dcebd7cf676d2 Mon Sep 17 00:00:00 2001 From: Darshan Thakkar Date: Wed, 24 Sep 2025 17:07:00 -0400 Subject: [PATCH 4/5] Remove name and replace with user --- src/ch2.3-using-git.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ch2.3-using-git.md b/src/ch2.3-using-git.md index 370fd80..87bb93c 100644 --- a/src/ch2.3-using-git.md +++ b/src/ch2.3-using-git.md @@ -92,9 +92,9 @@ From this main code you can create branches, this allows you to make changes wit Let's create a new branch using this command: -`git checkout -b darshan/feature-a` +`git checkout -b user/feature-a` -You should now be on the `darshan/feature-a` branch. You can check this by running the `git branch` command. +You should now be on the `user/feature-a` branch. You can check this by running the `git branch` command. Next, let's add a change to this branch @@ -118,10 +118,10 @@ hello.txt ### Merging Branches -To update the `main` branch with the changes from `darshan/feature-a`, run this command. +To update the `main` branch with the changes from `user/feature-a`, run this command. ```bash -$ git merge darshan/feature-a +$ git merge user/feature-a Updating f365571..0d24068 Fast-forward foo.txt | 1 + @@ -129,7 +129,7 @@ Fast-forward create mode 100644 foo.txt ``` -If the files modified in `main` and `darshan/feature-a` (after `darshan/feature-a` was created or after the last merge) are mutually exclusive, then git should be able to do this automatically. However, if the same file was modified in both branches, you will encounter a merge conflict. Let's test this. +If the files modified in `main` and `user/feature-a` (after `user/feature-a` was created or after the last merge) are mutually exclusive, then git should be able to do this automatically. However, if the same file was modified in both branches, you will encounter a merge conflict. Let's test this. First, we'll make a change on the `main` branch. @@ -139,7 +139,7 @@ git add . git commit -m "Update hello.txt" ``` -Next, let's make a change on the `darshan/feature-a` branch without updating (merging) the new changes on `main`. +Next, let's make a change on the `user/feature-a` branch without updating (merging) the new changes on `main`. ```bash echo "Hello engineering students!" >> hello.txt @@ -151,7 +151,7 @@ Now let's try to merge this. ```bash $ git checkout main -$ git merge darshan/feature-a +$ git merge user/feature-a Auto-merging hello.txt CONFLICT (content): Merge conflict in hello.txt Automatic merge failed; fix conflicts and then commit the result. @@ -166,7 +166,7 @@ hello world Hello CSU ======= Hello engineering students! ->>>>>>> darshan/feature-a +>>>>>>> user/feature-a ``` To resolve this, replace the text above with the final desired version (it could be one or the other, or a combination of both). Once you've resolved all of the conflicts in (and saved) each file, stage the files and create a new commit. This completes the merge process. @@ -188,10 +188,10 @@ git commit -m "Merge feature-a into main" **Note:** you can also use `git commit` without a commit message. It will then open an editor for you the write the commit message. once you save the message and exit the editor, git will make the commit. -Afterwards, you may delete `darshan/feature-a`. +Afterwards, you may delete `user/feature-a`. ```bash -git branch -d darshan/feature-a +git branch -d user/feature-a ``` ## Remotes From 8252507cc78b32e5823e688e8d463111ff309c3b Mon Sep 17 00:00:00 2001 From: Darshan Thakkar Date: Wed, 24 Sep 2025 18:50:56 -0400 Subject: [PATCH 5/5] Add git best practices --- src/ch2.3-using-git.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/ch2.3-using-git.md b/src/ch2.3-using-git.md index 87bb93c..2eae6c3 100644 --- a/src/ch2.3-using-git.md +++ b/src/ch2.3-using-git.md @@ -237,3 +237,21 @@ Visual Studio Code has integrated source control management (SCM) and includes G - https://code.visualstudio.com/docs/sourcecontrol/overview - https://www.gitkraken.com/blog/vs-code-git + +### Git Best Practices + +- Commit Often: Make small, frequent commits to capture your progress. + +- Write Clear Commit Messages: Use descriptive messages that explain why a change was made, not just what changed. + +- Use Branches: Create branches for features, fixes, and experiments to keep your main branch stable. + +- Pull Before You Push: Always `git pull` before pushing. + +- Review Changes Before Committing: Use `git status` and `git diff` to review your changes before you commit. + +- Keep Repositories Small: Avoid adding large files or unnecessary dependencies. + +- Use .gitignore: Exclude files that shouldn't be tracked (like build artifacts, log files, or secrets) by adding them to a `.gitignore` file. + +https://www.w3schools.com/git/git_best_practices.asp