Log into GitHub and create a new repository. • Choose any appropriate name. • Again, make this a private repository. • Do NOT however, select any of the options to initialize the repository with README or other files. Leave the repository empty for the moment. • Click the Create Repository button. 2. The next page offers a lot of options for dealing with the fact that your repository is still uninitialized. Scroll to the last option “import code from another repository” and click the Import Code button. 3. Next you will be asked for the URL of the “old” repository that you want to import. You are going to make a fork of one of my repositories. A fork means that you are making a copy of another project but not joining my project. You are striking out on your own with the other project’s code as a starting point. In a separate tab/window of your browser, visit this project of mine. From the green Code button, copy the HTTPS URL. 4. Return to the tab with your own new project and paste that URL into the “old repository’s clone URL” box. Click the begin Import button. After a short time, you will be informed that your repository is ready. Browse to it and see what files it contains. 5. In an SSH session, cd to ~/UnixCourse. 6. Clone your new “CS252 IDEs Asst” repository. 7. Do an ls. you should see a new directory in ~/UnixCourse/ matching whatever name you gave to your repository. Rename that directory to ~/UnixCourse/idesAsst. 8. Edit the README.md file, inserting your @odu.edu email address where indicated. Save your changes. 9. Commit your changes and push them to the origin repository on GitHub. 10. Give the command ~cs252/bin/gitAsst to check your work.
The Correct Answer and Explanation is:
Correct Answer:
This task walks you through forking and setting up a GitHub repository, cloning it locally, editing a file, and pushing changes. Follow these steps precisely:
Step-by-step Instructions
- Create a Private Repository on GitHub:
- Log in to your GitHub account.
- Click the + icon (top-right), then choose New repository.
- Name it something like
CS252-IDEs-Asst
. - Set it to Private.
- Do not check any boxes (no README, .gitignore, or license).
- Click Create repository.
- Import Code from Another Repository:
- After creating the empty repo, scroll down to “Import code from another repository”.
- Open a new browser tab, navigate to your instructor’s GitHub repository.
- Click the green Code button, copy the HTTPS link.
- Go back to your repo and paste that URL into the import box.
- Click Begin Import.
- Wait for GitHub to finish importing the files.
- Clone the Repository Locally:
- Open an SSH session (e.g., in your terminal).
- Run: bashCopyEdit
cd ~/UnixCourse git clone https://github.com/your-username/CS252-IDEs-Asst.git
- Replace the URL with the one from your GitHub repo.
- Rename the Directory:
- After cloning: bashCopyEdit
mv CS252-IDEs-Asst idesAsst cd idesAsst
- After cloning: bashCopyEdit
- Edit the README.md File:
- Use an editor like
nano
,vim
, orgedit
: bashCopyEditnano README.md
- Locate the placeholder for your email and insert your
@odu.edu
email. - Save and close the file.
- Use an editor like
- Commit and Push the Change: bashCopyEdit
git add README.md git commit -m "Added my odu.edu email to README" git push origin main
- Run the Verification Script: bashCopyEdit
~cs252/bin/gitAsst
Explanation
This assignment teaches essential GitHub and Unix workflow skills. The process starts by creating a private GitHub repository without initialization files. This ensures that you begin with a clean slate, which is necessary for importing existing code from another repository.
Next, instead of forking directly, GitHub’s import tool is used. This tool copies the code into your new repository without establishing a link to the original author’s repository. You paste the HTTPS clone URL of your instructor’s repository into the import tool and start the import process. Once complete, the code becomes yours to modify.
Afterward, you open a terminal and navigate to the ~/UnixCourse
directory. This location is commonly used for course-related work. Using the git clone
command, you bring a copy of your GitHub repository into your local Unix environment. Cloning links your local files to the GitHub repository, enabling you to sync changes between them.
You then rename the directory using the mv
command to match the expected idesAsst
name, which is likely required by grading scripts.
Inside the directory, you locate and edit the README.md
file, inserting your ODU email. This shows that you understand how to edit files and personalize documentation.
After editing, you stage the change with git add
, record it with git commit
, and push it to GitHub using git push
. This mirrors the process developers use daily to update and share their work.
Finally, running the ~cs252/bin/gitAsst
script allows your instructor’s system to verify that your work is complete and correct.
