Coder Social home page Coder Social logo

fork-practice's Introduction

Directions:

  1. Fork this repo by clicking Fork in the top-right corner. Awesome, now you know how to fork. All of the directions below are just other cool things you can do with Git & Github.
  2. Now that you have your own copy, go into the repo settings (gear icon) and rename your copy to forking-practice.
  3. Clone your remote copy into your local IDE.
  4. Make a new directory in this repo named subdir
  5. READ what your command line says back to you when you try to add/commit/push!
  6. Since we can't commit an empty directory, cd into subdir and create a file named ready.txt. Go ahead and put some text in that file: it can be whatever you want. But hold on, don't commit yet.
  7. Go back up one level to the top-level directory by doing cd .. and make a file named notready.txt.
  8. Use git status to see that both notready.txt and subdir/ are in red (really, subdir/ in this case means subdir/notready.txt).
  9. While we typically use git add . to add everything to the stage, let's imagine that subdir/ready.txt is ready to be committed, but notready.txt isn't. So try git add subdir/ready.txt to make sure that we add only that file to the stage, and NOT notready.txt.
  10. Do git status again to confirm that subdir/ready.txt is green, and notready.txt is red.
  11. Go ahead and commit, then push!
  12. If you haven't already, reload your fork on GitHub. You should see your changes, except for notready.txt.
  13. One last thing. You know how you can see the exact changes in commits by looking at them on Github? Here is an example. But what about local changes that haven't been committed yet: how do we know what we've done locally before we commit and push them to Github? After all, this would probably help us come up with a good commit message ("wait... what did I do since my last commit?"). To show you, go ahead and change some text in your subdir/ready.txt file: again, it can be whatever you want. Now in your terminal, type git diff to see what you've changed since your last commit. Pretty cool, eh? Go ahead and add/commit/push JUST that file again (notready.txt is still not ready).

That's it, you're done!

To recap, we saw that:

  • You can't commit an empty directory.
  • You can add just some things to the stage, and thus not commit everything.
  • You can see any new uncommitted local changes by doing git diff.

fork-practice's People

Contributors

bmuellerhstat avatar katherinew5896 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.