Giter VIP home page Giter VIP logo

git-practice's Introduction

git-practice

This is a very simple tutorial that gives new Hack Reactor students who are unfamiliar with Git an opportunity to practice adding remote repos, pulling from remote repos, and resolving merge conflicts.

  1. Fork this repo
  2. Clone your fork of this repo (git clone <GITHUB_URL_OF_YOUR_FORK>)
  3. Add this repo as an upstream remote (git remote add upstream https://github.com/HR40-Precourse/git-practice.git)
  4. Add a remote to your pair's repo (git remote add https://github.com/<PAIRS_GITHUB_HANDLE>/git-practice.git)
  • you can always push work to your pair's repo with: git push master (or )
  1. Type git remote -v to see all the remote repos to which you have reference
  2. Take a look at app.js
  3. Let's imagine that your upstream remote has changed and you want to pull down the changes from it
  • Type 'git pull upstream changes' into the command line
  • (technically this pulls changes from a branch on the upstream remote called 'changes', most of the time you'd use git pull upstream master to pull from the master branch)
  • Notice how app.js has changed
  1. Let's imagine that your pair leaves for a meeting and you want to continue working on the repo on your own, but don't want to overwrite anything. This is when you would cut your own branch (git checkout -b )
  2. In the new branch, change the name property to another name.
  3. Now your pair is back so you'll want to checkout your local master again. Make another change to the name property of randomPerson that is different from the name you used in the other branch.
  4. Commit and push your changes back to the origin master
  5. Let's say you want to continue doing more work on your again, but you want the new changes that you made from the origin master that your pair and you were working on together. Check out your own branch (git checkout ) and then pull from the origin master (git pull origin master).
  6. Your terminal should now be telling you that you have a merge conflict. Open app.js and delete the unneccessary lines to fix your conflicts. Then add and commit the changed file to continue the merge.

git-practice's People

Contributors

msmith9393 avatar rochness avatar

Watchers

 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.