{"id":28089233,"url":"https://github.com/radmanesh/git-workshop-demo-2025","last_synced_at":"2026-05-01T03:34:18.632Z","repository":{"id":289017753,"uuid":"968884973","full_name":"radmanesh/git-workshop-demo-2025","owner":"radmanesh","description":"This repository supports a hands-on workshop introducing Git fundamentals to graduate students and early-stage developers. The 2-hour session covers version control concepts, local and remote workflows, branching, merging, conflict resolution, and GitHub collaboration.","archived":false,"fork":false,"pushed_at":"2025-04-22T05:14:12.000Z","size":378,"stargazers_count":7,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-08T09:47:27.495Z","etag":null,"topics":["git","github"],"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/radmanesh.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,"zenodo":null}},"created_at":"2025-04-18T23:14:32.000Z","updated_at":"2025-04-23T16:39:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"8cbe3854-459d-4a87-b78e-0f0c0b6d73f7","html_url":"https://github.com/radmanesh/git-workshop-demo-2025","commit_stats":null,"previous_names":["radmanesh/git-workshop-demo-2025"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/radmanesh/git-workshop-demo-2025","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radmanesh%2Fgit-workshop-demo-2025","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radmanesh%2Fgit-workshop-demo-2025/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radmanesh%2Fgit-workshop-demo-2025/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radmanesh%2Fgit-workshop-demo-2025/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/radmanesh","download_url":"https://codeload.github.com/radmanesh/git-workshop-demo-2025/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radmanesh%2Fgit-workshop-demo-2025/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32484352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","github"],"created_at":"2025-05-13T12:55:19.056Z","updated_at":"2026-05-01T03:34:18.620Z","avatar_url":"https://github.com/radmanesh.png","language":null,"readme":"# Git Introduction Workshop\n\n## Reach here\n\n![QR failed loading!](/qrcode.png)\n\n## Other Links\n\n### [2-Page Git Cheat-Sheet (PDF)](https://raw.githubusercontent.com/radmanesh/git-workshop-demo-2025/refs/heads/main/CheatSheet.pdf)\n### [Wiki (NEW!)](https://github.com/radmanesh/git-workshop-demo-2025/wiki)\n### [Git Introduction Workshop (Word)](https://sooners-my.sharepoint.com/:w:/r/personal/radmanesh_ou_edu/Documents/Git%20Introduction%20Workshop.docx?d=wdc22cdcb84e748809bd5b0f1e101d0c8\u0026csf=1\u0026web=1\u0026e=pX0kRV)\n\n---\n\n## Welcome \u0026 Objectives\n\n### What is Git and Why Use It?\n- **Distributed version control** (tracks changes, supports collaboration, maintains history)\n- Created in 2005 by Linus Torvalds, the creator of Linux\n- Compared to SVN and Mercurial:\n  - **Distributed architecture**\n  - More flexible workflow\n- Relevance for graduate students:\n  - Efficient tracking of research and development\n  - Enables collaboration\n  - Operates offline\n  - Industry-standard tool\n\n---\n\n## Git Basic Definitions\n\n| Concept | Description |\n|---------|-------------|\n| **Repository (repo)** | Project tracked by Git, can be local or remote (e.g., GitHub, GitLab). |\n| **Commit** | Snapshot of project state at a certain point, with descriptive message. |\n| **Branch** | Separate development line; used for features without disturbing main project. |\n| **Merge** | Combines changes from different branches. |\n| **Clone** | Copies a remote repository to your local machine. |\n| **Push/Pull** | Send commits to remote repository / Retrieve updates from remote repository. |\n| **Fork** | Personal copy of another user's repository on GitHub/GitLab. |\n\n---\n\n## First-Time Setup\n\n### Installation \u0026 Setup\n- [Create GitHub account](https://github.com/)\n- Install Git ([Windows/Mac/Linux](https://git-scm.com/downloads))\n- Configure Git globally:\n```bash\ngit config --global user.name \"Your Name\"\ngit config --global user.email \"your_email@example.com\"\n```\n- Create and clone repository from GitHub:\n```bash\ngit clone \u003crepo-link\u003e\n```\n\n### Starting a Repository\n- Initialize local repository:\n```bash\ngit init\n```\n- File states: **Untracked**, **Staged**, **Committed**\n\n---\n\n## Basic Workflow\n\n### Adding Changes\n```bash\ngit add \u003cfile\u003e\ngit add .\n```\n\n### Making a Commit\n```bash\ngit commit -m \"commit message\"\ngit status\ngit log --oneline\n```\n\n### Using Git Diff\n- View unstaged changes:\n```bash\ngit diff\n```\n- Diff between commits:\n```bash\ngit diff \u003ccommit1\u003e \u003ccommit2\u003e\n```\n- Diff staged changes:\n```bash\ngit diff --staged\n```\n\n### Inspecting the Repository\n- Check repository status:\n```bash\ngit status\n```\n- Inspect commit details:\n```bash\ngit show \u003ccommit\u003e\n```\n\n---\n\n## Branching \u0026 Merging\n\n### Why Branching Matters\n- Enables isolated feature development\n- Keeps main branch stable\n\n### Creating \u0026 Switching Branches\n- Create and switch branches:\n```bash\ngit branch \u003cbranch-name\u003e\ngit switch \u003cbranch-name\u003e\n```\n- Shortcut to create and switch:\n```bash\ngit switch -c \u003cbranch-name\u003e\n```\n\n### Merging Changes\n- Merge feature branch into main:\n```bash\ngit switch main\ngit merge \u003cbranch-name\u003e\n```\n- Merge methods:\n  - Fast-forward (simple merges)\n  - 3-way merge (complex merges)\n- Resolve merge conflicts manually:\n  - Identify conflicts (`git status`, `git diff`)\n  - Edit conflicted files, remove markers, commit resolved changes\n\n### Branching Best Practices\n- Short-lived branches for features\n- Clear, descriptive branch names\n- Use graphical tools (`git log --graph --oneline --all`) for visualization\n\n---\n\n## Working with Remotes\n\n### What Are Remotes?\n- Repositories on remote servers (GitHub)\n- Supports collaboration via pull requests and issue tracking\n\n### Setting Up SSH Keys\n- Create SSH keys:\n```bash\nssh-keygen -t ed25519 -C \"your_email@example.com\"\ncat ~/.ssh/id_ed25519.pub\n```\n- Add SSH key to GitHub under account settings\n\n### Adding a Remote\n```bash\ngit remote add origin \u003cURL\u003e\ngit remote -v\n```\n\n### Syncing Changes\n- Push commits:\n```bash\ngit push origin \u003cbranch-name\u003e\n```\n- Fetch and merge remote changes:\n```bash\ngit pull origin \u003cbranch-name\u003e\n```\n- Fetch without merging:\n```bash\ngit fetch\n```\n\n### Forking vs. Cloning\n- **Fork**: Personal GitHub copy (common in open-source)\n- **Pull requests**: Propose merging your forked changes into original repository\n\n---\n\n## Common Pitfalls \u0026 How to Fix Them\n\n### Merge Conflicts Exercise\n- Clone demo repository:\n```bash\ngit clone https://github.com/radmanesh/git-workshop-demo-2025\n```\n- Create branches:\n```bash\ngit switch -c groupA-branch  # Group A\ngit switch -c groupB-branch  # Group B\n```\n- Modify `team.txt`:\n  - Group A: Replace \"Bob\" with \"Charlie\"\n  - Group B: Replace \"Bob\" with \"Dana\"\n\n- Commit changes:\n```bash\ngit add team.txt\ngit commit -m \"Changed Bob to Charlie\"   # Group A\ngit commit -m \"Changed Bob to Dana\"      # Group B\n```\n- Push changes:\n```bash\ngit push origin groupA-branch\ngit push origin groupB-branch\n```\n- Merge on GitHub: Merge Group A’s PR to main\n- Group B pulls main and faces conflicts:\n```bash\ngit switch main\ngit pull origin main\ngit switch groupB-branch\ngit merge main  # Resolve conflicts manually\n```\n\n### Detached HEAD State\n- Occurs checking out specific commit directly\n- Recover by switching to a branch:\n```bash\ngit switch main  # or\ngit switch -c new-branch\n```\n\n### Reverting vs. Resetting\n- Safely undo a commit:\n```bash\ngit revert \u003ccommit\u003e\n```\n- Rewrite history (with caution):\n```bash\ngit reset --hard \u003ccommit\u003e\n```\n\n### `.gitignore` Issues\n- Ignore files properly:\n  - `.gitignore` file\n  - Remove already-committed files:\n```bash\ngit rm --cached \u003cfile\u003e\n```\n\n---\n\n## Copilot Online Queries (Optional)\n- View repository history clearly:\n```bash\ngit log --oneline --graph --decorate --all\n```\n- Document pull requests clearly with messages and comments for detailed collaboration.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradmanesh%2Fgit-workshop-demo-2025","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fradmanesh%2Fgit-workshop-demo-2025","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradmanesh%2Fgit-workshop-demo-2025/lists"}