From a204569a26a0bffe4b1d130b604254931d569f0b Mon Sep 17 00:00:00 2001 From: Magdel Date: Fri, 22 Aug 2025 20:50:24 +0000 Subject: [PATCH] Update GIT_ASSIGNMENT.md --- GIT_ASSIGNMENT.md | 91 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/GIT_ASSIGNMENT.md b/GIT_ASSIGNMENT.md index 54cc5be..1b24cf7 100644 --- a/GIT_ASSIGNMENT.md +++ b/GIT_ASSIGNMENT.md @@ -307,6 +307,97 @@ index 5a4b868..0000000 ``` +# 7. Creating & Switching Branches + +Assignment: + + Create a branch feature/feature-1: + + git branch feature/feature-1 + git checkout feature/feature-1 + +Add a line to notes.txt and commit it. + +Switch back to main: + +git checkout main + + Observe how the file content changes. + +### My Work +`git branch feature/feature-1` +`git checkout feature/feature-1` +### Result +`Switched to branch 'feature/feature-1'` +#### Result +``` +Magdel@LAPTOP-NS5FVUS9 MINGW64 ~ (feature/feature-1) +$ git branch +* feature/feature-1 + master +``` + +###My Work +``` +echo "This note was made on 23rd August 2025" >> notes.txt +git add notes.txt`` + +#### Result +``` +Magdel@LAPTOP-NS5FVUS9 MINGW64 ~ (feature/feature-1) +$ git status +warning: could not open directory 'Application Data/': Permission denied +warning: could not open directory 'Cookies/': Permission denied +warning: could not open directory 'Documents/My Music/': Permission denied +warning: could not open directory 'Documents/My Pictures/': Permission denied +warning: could not open directory 'Documents/My Videos/': Permission denied +warning: could not open directory 'Local Settings/': Permission denied +warning: could not open directory 'My Documents/': Permission denied +warning: could not open directory 'NetHood/': Permission denied +warning: could not open directory 'PrintHood/': Permission denied +warning: could not open directory 'Recent/': Permission denied +warning: could not open directory 'SendTo/': Permission denied +warning: could not open directory 'Start Menu/': Permission denied +warning: could not open directory 'Templates/': Permission denied +On branch feature/feature-1 +Changes to be committed: + (use "git restore --staged ..." to unstage) + modified: notes.txt +``` + +### My Work - Commit +`git commit -m "New Note" + +#### Result +``` +Magdel@LAPTOP-NS5FVUS9 MINGW64 ~ (feature/feature-1) +$ git commit -m "New Note" +[feature/feature-1 d2ef265] New Note + 1 file changed, 1 insertion(+) +``` +###My work +`git checkout master` +#### Result +``` +Magdel@LAPTOP-NS5FVUS9 MINGW64 ~ (feature/feature-1) +$ git checkout master +Switched to branch 'master' +``` + +# 8. Cloning a Remote Repository + +Assignment: + + Go to Git Comorin and verify your repo in Git-Training-Hub exists. + + Run: + + git clone cloned-repo + +Verify by listing files inside cloned-repo. + + +