{"id":17363085,"url":"https://github.com/tomastomecek/mastering-git-labs","last_synced_at":"2025-02-26T12:32:35.600Z","repository":{"id":60859039,"uuid":"538918650","full_name":"TomasTomecek/mastering-git-labs","owner":"TomasTomecek","description":"Mastering git FI MUNI course: class 2 \u0026 3 labs","archived":true,"fork":false,"pushed_at":"2023-10-02T21:05:02.000Z","size":27,"stargazers_count":1,"open_issues_count":4,"forks_count":15,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-16T22:40:57.619Z","etag":null,"topics":["git"],"latest_commit_sha":null,"homepage":"","language":null,"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/TomasTomecek.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}},"created_at":"2022-09-20T09:56:49.000Z","updated_at":"2023-10-03T14:17:51.000Z","dependencies_parsed_at":"2023-10-03T02:26:12.878Z","dependency_job_id":"3c302840-99b8-432c-b085-89109a1ea66c","html_url":"https://github.com/TomasTomecek/mastering-git-labs","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/TomasTomecek%2Fmastering-git-labs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasTomecek%2Fmastering-git-labs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasTomecek%2Fmastering-git-labs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasTomecek%2Fmastering-git-labs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomasTomecek","download_url":"https://codeload.github.com/TomasTomecek/mastering-git-labs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240852910,"owners_count":19868332,"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":["git"],"created_at":"2024-10-15T19:45:26.839Z","updated_at":"2025-02-26T12:32:35.256Z","avatar_url":"https://github.com/TomasTomecek.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mastering git: class 2 lab\n\n\n## Class 5\n\nTBD\n\n### Lab\n\n* I think reset, checkout\n* Would be nice to resolve some conflicts or something\n* Rebase is always great\n\n\n## Class 4\n\nContent missing\n\n\n## Class 3\n\n* Push \u0026 pull\n* Remotes\n* Pull requests\n\n### Lab\n\n* find a file with your `\u003cUCO\u003e.txt` and write down what’s the most valuable thing you learnt so far on this course\n* CI needs to pass\n* BONUS: contribute also to `what_we_learnt.txt` (beware of rebase and merge conflicts!)\n\n\n## Class 2\n\n* Branches\n* Tags\n* Merging\n* Stash\n\n### Lab\n\n#### Setup\n\n* Clone this repository (clone it again even if you have a copy locally)\n  * Run `git branch add-lab-description origin/add-lab-description`\n  * Run `git branch wip-show-sample-commands origin/wip-show-sample-commands`\n  * These commands will create local copies of branches from remote origin: in this repository\n\n#### Tasks\n\n* Delete branch “wip-show-sample-commands”\n* Does the “add-lab-description” top commit look okay?\n  * Fix the problem once you spot it\n* Create a new branch that starts from \"add-lab-description\", name it “fix”\n* Oh, that’s not a good branch name, sorry. Rename the branch from “fix” to “fix-add-lab-description”\n* Merge fix-add-lab-description into main\n* BONUS: push your local main into your fork\n* EPIC BONUS: Create a pull request from fix-add-lab-description to this repository\n\n### Solution\n\nYou are still free to do this task.\n\n\u003cdetails\u003e\n  \u003csummary\u003eClick only when you want to see the solution for this lab with the explanation for commands.\u003c/summary\u003e\n\n  1. Delete the branch: `git branch -D wip-show-sample-commands` (has to be `-D` since the branch is not merged).\n  2. `git switch add-lab-description`, let's work on the \"add-lab-description\" branch.\n  3. There is a typo in README.md, we can fix it easily: `workflowwwwwwwwwwwwwwwwwwwwww` → `workflow`.\n  4. `git commit -a -m 'fix typo in readme'` - we want to preserve the original commit.\n  5. `git switch -c fix`: instructions say to create this branch.\n  6. Uhhhh, make your mind! 😄 `git branch -m fix fix-add-lab-description`\n  7. `git switch main \u0026\u0026 git merge fix-add-lab-description`: merged, sweet!\n  8. In order to push, we need to set up our fork remote, but let's do this properly:\n\n   * `git remote rename origin upstream`: we want our for to be the default and the actual upstream repo to be named \"upstream\"\n   * `git remote add origin git@github.com:$USERNAME/mastering-git-class2-lab`: now to set up our fork\n   * `git fetch --all`: let's fetch all refs to be sure we set it up correctly\n\n  9. Let's push to our fork's main to see our change: `git push origin main:main` (we are telling git to push our local branch `main` into our fork repository and name the branch `main` there: so basically put our new local commits from main into fork's main)\n  10. The best practice is to create pull requests from dedicated branches, not main, so let's push again: `git push origin fix-add-lab-description:fix-add-lab-description`\n  11. Time to create the PR!\n\n\u003c/details\u003e\n\nDid you find a problem? Something doesn't work? Please ask or contribute a fix.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomastomecek%2Fmastering-git-labs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomastomecek%2Fmastering-git-labs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomastomecek%2Fmastering-git-labs/lists"}