{"id":32670,"date":"2025-06-22T17:38:02","date_gmt":"2025-06-22T17:38:02","guid":{"rendered":"https:\/\/gaviki.com\/blog\/?p=32670"},"modified":"2025-06-22T17:38:04","modified_gmt":"2025-06-22T17:38:04","slug":"log-into-github-and-create-a-new-repository","status":"publish","type":"post","link":"https:\/\/gaviki.com\/blog\/log-into-github-and-create-a-new-repository\/","title":{"rendered":"Log into GitHub and create a new repository."},"content":{"rendered":"\n<p> Log into GitHub and create a new repository. \u2022 Choose any appropriate name. \u2022 Again, make this a private repository. \u2022 Do NOT however, select any of the options to initialize the repository with README or other files. Leave the repository empty for the moment. \u2022 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 &#8220;import code from another repository&#8221; and click the Import Code button. 3. Next you will be asked for the URL of the &#8220;old&#8221; 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&#8217;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 &#8220;old repository&#8217;s clone URL&#8221; 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 &#8220;CS252 IDEs Asst&#8221; 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.<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">The Correct Answer and Explanation is:<\/mark><\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Correct Answer:<\/h3>\n\n\n\n<p>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:<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Step-by-step Instructions<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Create a Private Repository on GitHub:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Log in to your GitHub account.<\/li>\n\n\n\n<li>Click the <strong>+<\/strong> icon (top-right), then choose <strong>New repository<\/strong>.<\/li>\n\n\n\n<li>Name it something like <code>CS252-IDEs-Asst<\/code>.<\/li>\n\n\n\n<li>Set it to <strong>Private<\/strong>.<\/li>\n\n\n\n<li><strong>Do not<\/strong> check any boxes (no README, .gitignore, or license).<\/li>\n\n\n\n<li>Click <strong>Create repository<\/strong>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Import Code from Another Repository:<\/strong>\n<ul class=\"wp-block-list\">\n<li>After creating the empty repo, scroll down to <strong>\u201cImport code from another repository\u201d<\/strong>.<\/li>\n\n\n\n<li>Open a <strong>new browser tab<\/strong>, navigate to your instructor&#8217;s GitHub repository.<\/li>\n\n\n\n<li>Click the <strong>green Code button<\/strong>, copy the <strong>HTTPS<\/strong> link.<\/li>\n\n\n\n<li>Go back to your repo and paste that URL into the import box.<\/li>\n\n\n\n<li>Click <strong>Begin Import<\/strong>.<\/li>\n\n\n\n<li>Wait for GitHub to finish importing the files.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Clone the Repository Locally:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Open an SSH session (e.g., in your terminal).<\/li>\n\n\n\n<li>Run: bashCopyEdit<code>cd ~\/UnixCourse git clone https:\/\/github.com\/your-username\/CS252-IDEs-Asst.git<\/code><\/li>\n\n\n\n<li>Replace the URL with the one from your GitHub repo.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Rename the Directory:<\/strong>\n<ul class=\"wp-block-list\">\n<li>After cloning: bashCopyEdit<code>mv CS252-IDEs-Asst idesAsst cd idesAsst<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Edit the README.md File:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Use an editor like <code>nano<\/code>, <code>vim<\/code>, or <code>gedit<\/code>: bashCopyEdit<code>nano README.md<\/code><\/li>\n\n\n\n<li>Locate the placeholder for your email and insert your <code>@odu.edu<\/code> email.<\/li>\n\n\n\n<li>Save and close the file.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Commit and Push the Change:<\/strong> bashCopyEdit<code>git add README.md git commit -m \"Added my odu.edu email to README\" git push origin main<\/code><\/li>\n\n\n\n<li><strong>Run the Verification Script:<\/strong> bashCopyEdit<code>~cs252\/bin\/gitAsst<\/code><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Explanation<\/h3>\n\n\n\n<p>This assignment teaches essential GitHub and Unix workflow skills. The process starts by creating a <strong>private<\/strong> GitHub repository without initialization files. This ensures that you begin with a clean slate, which is necessary for importing existing code from another repository.<\/p>\n\n\n\n<p>Next, instead of forking directly, GitHub\u2019s <strong>import tool<\/strong> is used. This tool copies the code into your new repository without establishing a link to the original author\u2019s repository. You paste the <strong>HTTPS clone URL<\/strong> of your instructor&#8217;s repository into the import tool and start the import process. Once complete, the code becomes yours to modify.<\/p>\n\n\n\n<p>Afterward, you open a terminal and navigate to the <code>~\/UnixCourse<\/code> directory. This location is commonly used for course-related work. Using the <code>git clone<\/code> 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.<\/p>\n\n\n\n<p>You then rename the directory using the <code>mv<\/code> command to match the expected <code>idesAsst<\/code> name, which is likely required by grading scripts.<\/p>\n\n\n\n<p>Inside the directory, you locate and edit the <code>README.md<\/code> file, inserting your ODU email. This shows that you understand how to edit files and personalize documentation.<\/p>\n\n\n\n<p>After editing, you stage the change with <code>git add<\/code>, record it with <code>git commit<\/code>, and push it to GitHub using <code>git push<\/code>. This mirrors the process developers use daily to update and share their work.<\/p>\n\n\n\n<p>Finally, running the <code>~cs252\/bin\/gitAsst<\/code> script allows your instructor&#8217;s system to verify that your work is complete and correct.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"852\" height=\"1024\" src=\"https:\/\/gaviki.com\/blog\/wp-content\/uploads\/2025\/06\/learnexams-banner8-424.jpeg\" alt=\"\" class=\"wp-image-32678\" srcset=\"https:\/\/gaviki.com\/blog\/wp-content\/uploads\/2025\/06\/learnexams-banner8-424.jpeg 852w, https:\/\/gaviki.com\/blog\/wp-content\/uploads\/2025\/06\/learnexams-banner8-424-250x300.jpeg 250w, https:\/\/gaviki.com\/blog\/wp-content\/uploads\/2025\/06\/learnexams-banner8-424-768x923.jpeg 768w\" sizes=\"auto, (max-width: 852px) 100vw, 852px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Log into GitHub and create a new repository. \u2022 Choose any appropriate name. \u2022 Again, make this a private repository. \u2022 Do NOT however, select any of the options to initialize the repository with README or other files. Leave the repository empty for the moment. \u2022 Click the Create Repository button. 2. The next page [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-32670","post","type-post","status-publish","format-standard","hentry","category-quiz-questions"],"_links":{"self":[{"href":"https:\/\/gaviki.com\/blog\/wp-json\/wp\/v2\/posts\/32670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gaviki.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gaviki.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gaviki.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gaviki.com\/blog\/wp-json\/wp\/v2\/comments?post=32670"}],"version-history":[{"count":1,"href":"https:\/\/gaviki.com\/blog\/wp-json\/wp\/v2\/posts\/32670\/revisions"}],"predecessor-version":[{"id":32679,"href":"https:\/\/gaviki.com\/blog\/wp-json\/wp\/v2\/posts\/32670\/revisions\/32679"}],"wp:attachment":[{"href":"https:\/\/gaviki.com\/blog\/wp-json\/wp\/v2\/media?parent=32670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gaviki.com\/blog\/wp-json\/wp\/v2\/categories?post=32670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gaviki.com\/blog\/wp-json\/wp\/v2\/tags?post=32670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}