This is a place for learners to share their code with other learners.
- Use your folder to keep your own code. Don't modify anyone else's files in their own folders
- Please try to use the naming convention of your own folders as leading with
pbsxxx-
. e.g.pbs146-shell-loops
. This will help others to find your code for a particular challenge. - Play nice.
The design of the pbs-challenges repo allows us all to see each other's work in progress, but it introduces a challenge. If you make a commit to your files, then I make a commit to my files, and then you check out your previous commit, my commit could be affected.
Here's the process to get back to your previous commit without borking anyone else's work.
-
Get rid of your local changes and restore the specific file(s) you will be changing back to your previous commit:
git restore filename
You should see a clean working tree withgit status
-
Create and checkout a new branch:
git checkout -b branchname
-
Revert to the commit using the hash of the commit:
git revert hash
This will automatically launch vi with a commit message created to document this revert. You can edit the commit message, or simply hit escape, followed by:wq!
to write, quite and save it as is. -
Check out the main branch:
git checkout main
-
Merge the branch you created into main:
git merge branchname
-
Clean things up by deleting the branch you created. You can see all branches with:
git branch --all
and then delete the branch with:git branch -d branchname
-
Applaud yourself for being a polite NosillaCastaway who plays nice.