GithubHelp home page GithubHelp logo

f6-individual-branch-practice's Introduction

f6-individual-branch-practice

Create a repo on GitHub.

Create a folder locally and add an index.html file

Add, commit, and then connect to the remote repo and push.

Pretend like the html file we just made is really complicated and we don't want to mess it up. We're going to create a new branch to work on by running

git checkout -b styles/main-styling

To go back to the main branch we run this command:

git checkout main

Let's go back to the style branch and then run git push. It will tell us that our branch has no upstream branch and give us a command to make one. Let's copy and run that command and then push up again.

In GitHub we should now see that we have two branches, and it should give us an option to compare them and make a pull request. Let's do that so we can merge our style branch into our main branch.

Now that we've merged that in, let's go back to our local main branch and make sure it reflects those changes by running git fetch to check for changes, and then git pull to add them to our local repo.

Branches in group projects.

The below instructions apply to and are echoed in this repo: https://github.com/suthyscott/branch-example-f6

Make a repo and send them all a link to view it. Pick a student and invite them to the group repo as a collaborator, and thave them clone the project.

Have all the other students fork and then clone it, then add a js file with a console.log of their name.

Have your student collaborator add their name to the index.html file.

Show how you don't have the student collaborator's changes yet, and pull them down. Show how that works.

To demonstrate conflicts, have the SC add another change at the same time as you added yours. Have them push up first, and show what happens (conflict errors) when you try to push up on the same branch.

To resolve these conflicts, make a new branch. Make a pull request and show how to resolve the conflicts in GitHub and merge it in.

For the students who forked and cloned, make sure they've added and pushed their changes. Explain that in an open source project you'll need to fork and clone the repos.

Have them create a new pull request to add their repo to your base repo. Then show you merging the pull requests in and how it updates the original repo. Now you can see and pull down the changes made by them in their forked repos. Note that forking does not create a new branch but rather a separate repo.

f6-individual-branch-practice's People

Contributors

suthyscott avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.