{"id":15762554,"url":"https://github.com/aem/practical-git","last_synced_at":"2025-03-13T20:32:03.685Z","repository":{"id":85882591,"uuid":"108920850","full_name":"aem/practical-git","owner":"aem","description":"For CS1210 @ Northeastern University","archived":false,"fork":false,"pushed_at":"2018-01-23T00:52:03.000Z","size":12,"stargazers_count":0,"open_issues_count":5,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-04T11:21:36.015Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-30T23:44:03.000Z","updated_at":"2017-10-31T04:59:28.000Z","dependencies_parsed_at":"2023-03-13T07:17:51.139Z","dependency_job_id":null,"html_url":"https://github.com/aem/practical-git","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aem%2Fpractical-git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aem%2Fpractical-git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aem%2Fpractical-git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aem%2Fpractical-git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aem","download_url":"https://codeload.github.com/aem/practical-git/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243478363,"owners_count":20297242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-04T11:21:05.201Z","updated_at":"2025-03-13T20:32:03.431Z","avatar_url":"https://github.com/aem.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FOR CCIS FELLOWS - REMOVE THIS SECTION AFTER FORKING\nCongrats on being selected as a fellow! Here's the practical Git lesson I wrote for the Fall 2017 semester. It was requested I make it repeatable for future semesters, so here we are. I'm comfortable maintaining this as long as GitHub is around (if you're reading this after that point...sorry ¯\\\\\\_(ツ)_/¯).\n\n### Maintenance\nIf there's something in the README that you or your class found confusing, please PR changes back into THIS repo (not your forked one) so that future semesters have the new version of the README.\n\nIf you'd like to add new questions to the project, you can do that too, just be mindful that it should be easy enough that students can finish it in a reasonable time in class. Also please add stubs and tests for all 3 languages, not just your favorite language.\n\n### Usage\nIn order to use this for your class, just:\n\n1. Fork the repo!\n2. Remove this section from the README\n3. Send YOUR link out to your students 1-2 days before class asking them to complete the tasks in [the setup section](/#setup)\n4. In class, have them walk through the steps below to answer a practice interview question, and that's it!!\n\n# FOR CCIS FELLOWS - REMOVE THE PREVIOUS SECTION AFTER FORKING\n\n# CS1210 Practical Git Lesson\n\nWelcome to Practical Git! Today we're going to practice working using git and GitHub the way they're used in the real world. My instructions will assume you're using the command line (using an app like **Terminal** or **iTerm**). You can also use a git GUI like SourceTree or GitHub Desktop, though you may have to search the Internet for instructions on how to use those.\n\nInstructions that involve a command-line tool will look like this:\n\n```sh\n$ git-command --argument\nthe output\n```\n\n### Setup\n\nBefore we start the tutorial, please make sure you've done the following things:\n\n1. [Create a GitHub account](https://github.com/join)\n2. [Install git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) (open a command line window and type `git`, if you see a list of available commands you already have git installed)\n3. [Set up your account locally](https://help.github.com/articles/set-up-git/)\n\n### Answering a Question\n\nWe'll walk through this in class, you do not need to do this before class.\n\n#### 1. Fork the Repository\n\nFor this exercise, you're going to do something called \"forking\" a repository. On co-op you'll be a member of a repository and you'll work off of something called a \"branch,\" but for open-source projects this will be the actual workflow. A fork is a copy of the repository that you own and can work on freely without affecting the original code.\n\nOn the top right corner of the page there should be a button that says \"Fork,\" you can click that and you're done!\n\n#### 2. Clone the Repository\n\nCloning a repository is the process of downloading the code to your machine. This creates a local copy that is linked to the version hosted on GitHub. To do this, in a directory dedicated to code you can run:\n\n```\n$ git clone https://github.com/MY_USERNAME/practical-git.git\nCloning into 'practical-git'...\nremote: Counting objects: 19, done.\nremote: Total 19 (delta 0), reused 0 (delta 0), pack-reused 19\nUnpacking objects: 100% (19/19), done.\n```\n*NOTE:* If you used SSH keys to set up git instead of HTTPS that url will become `git@github.com:MY_USERNAME/practical-git.git`.\n\n#### 3. Make your changes!\n\nOnce you've got the code on your machine, you'll see a few language-specific folders. Each folder contains the same questions, so just choose your favorite language and open that folder in your IDE/Editor of choice!\n\nGo ahead and code out the solution to the problem, maybe even write some tests to prove it works :)\n\n#### 4. Put your changes back on GitHub\n\nNow we're going to create what's called a \"commit.\" A commit is a small chunk of code that represents a complete piece of work. Normally you'd commit any time you reach a stopping point, but for simplicity's sake we'll just commit once you're done writing code.\n\nAn important part of a commit is the \"commit message,\" you need to write a descriptive message telling everyone else what code is in your commit. A bad message would be something like `some changes`, a good message would be something like `implemented and wrote tests for python palindrome problem`.\n\nTo create a new commit, we need to tell git which files we want to add, create the commit itself, and then \"push\" it up to GitHub:\n\n```sh\n$ git add .  # adds all files in the current directory. you could put an\n             # individual file path if you only want to commit a specific file\n$ git commit -m \"YOUR MESSAGE HERE\"\n[master 12345678] YOUR MESSAGE HERE\n 2 files changed, 58 insertions(+)\n$ git push origin master\nCounting objects: 4, done.\nDelta compression using up to 8 threads.\nCompressing objects: 100% (4/4), done.\nWriting objects: 100% (4/4), 826 bytes | 826.00 KiB/s, done.\nTotal 4 (delta 1), reused 0 (delta 0)\nremote: Resolving deltas: 100% (1/1), completed with 1 local object.\nTo github.com:MY_USERNAME/practical-git\n   8a5b2fd..29d9916  master -\u003e master\n```\n\n#### 5. Submit a request to merge your code\n\nIn order to actually get your code back into the original project, you have to submit what's called a \"Pull Request,\" a request for the project owner to \"pull\" the changes you've made on your fork back into the original project. To do this, navigate to the GitHub page for your fork (should be https://github.com/YOUR_USERNAME/practical-git).\n\nAt the top you should see a yellow bar prompting you to create a pull request, click on the \"Compare and Pull Request\" button.\n\nOn the next page, put in a title, a brief description of your changes (in this case, your solution), and click \"Create Pull Request\"!\n\n#### 6. Project Owner Merges Code\n\nOn co-op you'll be doing this yourself once someone else reviews your code, but in open source projects the project owner is in charge of merging. In fact, you likely will not even have permissions to merge the PR unless you've been added as a contributor.\n\nIn this stage you may have to resolve \"merge conflicts,\" when two people modify the same code and git can't tell Whose Code Is It Anyway. We can walk through this in person as it's a little complex to cover in this README.\n\n#### 7. That's it! You're all set!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faem%2Fpractical-git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faem%2Fpractical-git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faem%2Fpractical-git/lists"}