{"id":26871131,"url":"https://github.com/codeadamca/github-demo-branching","last_synced_at":"2025-07-19T13:35:01.212Z","repository":{"id":44627266,"uuid":"454862237","full_name":"codeadamca/github-demo-branching","owner":"codeadamca","description":"A demo GitHub repository for introducing students to Git and GitHub. ","archived":false,"fork":false,"pushed_at":"2025-02-03T19:02:49.000Z","size":4252,"stargazers_count":0,"open_issues_count":36,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-31T07:18:28.998Z","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/codeadamca.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":"2022-02-02T17:01:58.000Z","updated_at":"2025-02-03T19:02:52.000Z","dependencies_parsed_at":"2025-01-26T22:21:11.059Z","dependency_job_id":"fa65e842-b156-4fe9-8a37-4771ed6c5b58","html_url":"https://github.com/codeadamca/github-demo-branching","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/codeadamca%2Fgithub-demo-branching","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fgithub-demo-branching/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fgithub-demo-branching/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fgithub-demo-branching/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeadamca","download_url":"https://codeload.github.com/codeadamca/github-demo-branching/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252826485,"owners_count":21810120,"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","github"],"created_at":"2025-03-31T07:18:33.294Z","updated_at":"2025-05-07T06:29:18.283Z","avatar_url":"https://github.com/codeadamca.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# A GitHub Demo Repo\n\nThis is a demo GitHub repository for introducing students to Git and GitHub. You will need a GitHub account to proceed. Make sure you [login](https://github.com/login) or [register](https://github.com/signup). \n\nPlease take a moment to notice that the registration page acts like a command line! That's kind of awesome!\n\n![GitHub Registration](_readme/screenshot-register.png)\n\n## Initial Setup\n\nThere are two possible scenarios when setting up a project and a Git repository:\n\n### Brand New Project\n\nIf you are starting a brand new project that does not have a GitHub repository you will need to follow these steps:\n\n1. Register or login to your GitHub account.\n\n2. Create a new GitHub repository. Give it a title using lowercase letters and dashes. Make it ```Public``` and Click ```Add a README file```.\n\n    ![New Repository](_readme/screenshot-new-repo.png)\n\n3. On the new repository page click the green ```Code``` button and copy the repository URL.\n\n    ![Copy URL](_readme/screenshot-code-url.png)\n\n4. Open up the Terminal or Command Prompt. If you do not have Git installed, [download and install GIT](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).\n\n5. Navigate to the folder you want to place your project in. To navigate folders use the following commands:\n\n    ```\n    # Change directoy\n    $ cd repository-name\n    # Go back a folder\n    $ cd ..\n    # Go to the root drive\n    $ cd /\n    ```\n\n6. In your working folder clone your new repository:\n\n    ```\n    $ git clone https://github.com/\u003cGUTHUB_USERNAME\u003e/\u003cREPO_NAME\u003e\n    ```\n\n7. This will create a new folder using the repository name. Change the direftory to that new folder:\n  \n    ```\n    $ cd \u003cREPO_NAME\u003e\n    ```\n\nYou are now setup and ready to follow the development cylcle instructions below.\n\n### Existing Project\n\nIf the \nsitry already exists and you want to contribute to the project follow these steps:\n\n1. Provide your uasername to the programmer who owns the project. The owner will need to login to their GitHub account and follow these steps:\n\n     - Navigate to the repository\n     - Click ```Settings```\n     - Click ```Collaborators```\n     - Click the ```Add People``` button\n     - Enter the username\n     - Click ```Add \u003cGITHUB_USERNAME\u003e to this repository```\n\n![Collaborator](_readme/screenshot-add-user.png)\n\n2. You will receive an email with the invitation details. Click ```View Invitation``` in the email and then ```Accept Invitation``` in the browser. You are not a contributor!\n\n3. Navigat to the repository. Click the ```Code``` button and copy the repositry URL. \n\n4. Open up the Terminal or Command Prompt. If you do not have Git installed, [download and install GIT](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).\n\n5. Navigate to the folder you want to place your project in. To navigate folders use the following commands:\n\n    ```\n    # Change directoy\n    $ cd repository-name\n    # Go back a folder\n    $ cd ..\n    # Go to the root drive\n    $ cd /\n    ```\n\n6. In your working folder clone your new repository:\n\n    ```\n    $ git clone https://github.com/\u003cGITHUB_USER\u003e/\u003cREPO_NAME\u003e\n    ```\n\n7. This will create a new folder using the repository name. Change the direftory to that new folder:\n\n    ```\n    $ cd \u003cREPO_NAME\u003e\n    ```\n\n8. Your ```github-demo``` folder contains a lot of Git settings. You can view these settings using the following commands:\n\n    ```\n    $ git config user.name\n    $ git config user.email\n    $ git config remote.origin.url\n    ```\n\n    We need to add a Personal Access Token to the origin URL to make sure you are authorized. In your browser, go to GitHub, and follow these steps:\n    \n    - Click on your profile avatar (top right)\n    - Click on ```Settings```\n    - Click on ```Developer Settings``` (last option)\n    - Click ```Personal Access Token```\n    - Click ```Generate New Token```\n    - Give the token a name, set the expiration to ```No Expiration```, and check off just ```repo```\n    - Copy your new token and save it somewhere, GitHub will not redisplay this token\n    \n    ![Personal Access Token](_readme/screenshot-token.png)\n    \n    In the terminal, run the following command to apply your Personal Access Token:\n    \n    ```\n    $ git remote set-url https://\u003cPERSONAL_ACCESS_TOKEN\u003e@github.com/codeadamca/github-demo\n    ```\n    \nYou are now setup and ready to follow the development cycle instructions below!!\n\n## Development Cycle\n\nNow that you have access to the repository and a local copy, it's time to make some changes! \n\nOpen up the IDE of your choice. I will be using [Visual Studio Code](https://code.visualstudio.com/). Using your IDE, open the folder that contains your repository. Also open up a terminal or command prompt and change the folder to the same repository. \n\nThere are two primary methods of commiting a change to a repository:\n\n### Directly to Main Branch\n\nIf you are working in a small group and everyone has access to the ```main``` branch, then group members can all make change and commit them directly to the ```main``` branch:\n\n1. In the terminal check on the status of your local repository:\n\n    ```\n    $ git status\n    ```\n    \n    You will be given a summary of which branch you are working on and a list of files that have been changed. At this point you should be on a branch called ```main``` and there should not be any changes that need to be commited. If there were changes, the files would be listed in red text.\n    \n    ```\n    On branch main\n    Your branch is up to date with 'origin/main'.\n    nothing to commit, working tree clean\n    ```\n\n2. Open up the files named ```main-content.md```. This is a [MarkDown](https://daringfireball.net/projects/markdown/) file! Using the table example, add a row with your name and a portfolio URL (if you have one).\n\n3. In your terminal, commit the changes to the ```main``` branch:\n    \n    ```\n    $ git status\n    $ git add .\n    $ git commit -am \"Add \u003cGITHUB_USERNAME\u003e to content\"\n    $ git push origin main\n    ```\n    \n    If someone has made changes since you last downloaded the content of the repository you will need to first update your local copy:\n    \n    ```\n    $ git pull origin main\n    ```\n\nCongratulations! You have officially contributed to the ```github-demo``` repository. Checn out your GitHub home page and view your contributions calendar. You have a green square!\n\n### Pull Request\n\nIf one group member is responsible for merging all code, the other group members can make their code contributions and then submit pull requests. \n\n1. In the terminal, create a new branch:\n\n    ```\n    $ git branch \u003cBRANCH_NAME\u003e\n    ```\n\n2. Checkout the new branch:\n\n    ```\n    $ git checkout \u003cBRANCH_NAME\u003e\n    ```\n\n3. Open up the files named ```branch-content.md```. Using the table example, add a row with your name and a portfolio URL (if you have one).\n\n4. Commit your changes:\n\n    ```\n    $ git add .\n    $ git commit -am \"Add \u003cGITHUB_USERNAME\u003e to content\"\n    $ git push origin \u003cBRANCH_NAME\u003e\n    ```\n\n5. Your changes have been pushed to the \u003cBRANCH_NAME\u003e branch in GitHub. You now need to create a ```Pull Request``` to request that your code be merged with the ```main``` branch. \n \n    After pushing to \u003cBRANCH_NAME\u003e you will receive a message like this:\n     \n    ```\n    Enumerating objects: 9, done.\n    Counting objects: 100% (9/9), done.\n    Delta compression using up to 8 threads\n    Compressing objects: 100% (6/6), done.\n    Writing objects: 100% (6/6), 608 bytes | 608.00 KiB/s, done.\n    Total 6 (delta 4), reused 0 (delta 0)\n    remote: Resolving deltas: 100% (4/4), completed with 3 local objects.\n    remote: \n    remote: Create a pull request for 'reorder' on GitHub by visiting:\n    remote:      https://github.com/codeadamca/github-demo/pull/new/reorder\n    remote: \n    To https://github.com/codeadamca/github-demo.git\n    * [new branch]      reorder -\u003e reorder\n    ```\n     \n    Go to the recommended URL in a browser and click ```Create Pull Request```. \n \n6. Now you can clean up your local repository:\n \n    ```\n    $ git checkout main\n    $ git merge \u003cBRANCH_NAME\u003e\n    $ git branch \u003cBRANCH_NAME\u003e -d\n    ```\n \nCongratulations! You are ready to work in a team environment!\n\n***\n\n## Repo Resources\n\n* [Visual Studio Code](https://code.visualstudio.com/) or [Brackets](http://brackets.io/) (or any code editor)\n* [GitHub](https://github.com/)\n* [Git](https://git-scm.com/)\n* [MarkDown](https://daringfireball.net/projects/markdown/)\n\n\u003cbr\u003e\n\u003ca href=\"https://codeadam.ca\"\u003e\n\u003cimg src=\"https://cdn.codeadam.ca/images@1.0.0/codeadam-logo-coloured-horizontal.png\" width=\"200\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Fgithub-demo-branching","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeadamca%2Fgithub-demo-branching","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Fgithub-demo-branching/lists"}