1 Git
1 Git
Branch
A branch is a parallel version of a repository. It is contained within the repository, but does not affect
the primary or master branch allowing you to work freely without disrupting the "live" version. When
you've made the changes you want to make, you can merge your branch back into the master branch to
publish your changes. For more information, see "About branches."
Clone
A clone is a copy of a repository that lives on your computer instead of on a website's server
somewhere, or the act of making that copy. With your clone you can edit the files in your preferred
editor and use Git to keep track of your changes without having to be online. It is, however, connected
to the remote version so that changes can be synced between the two. You can push your local changes
to the remote to keep them synced when you're online.
Commit
A commit, or "revision", is an individual change to a file (or set of files). It's like when you save a file,
except with Git, every time you save it creates a unique ID (a.k.a. the "SHA" or "hash") that allows you
to keep record of what changes were made when and by who. Commits usually contain a commit
message which is a brief description of what changes were made.
Glossary
Fetch
Fetching refers to getting the latest changes from an online repository without merging them
in. Once these changes are fetched you can compare them to your local branches (the code
residing on your local machine).
Fork
A fork is a personal copy of another user's repository that lives on your account. Forks allow
you to freely make changes to a project without affecting the original. Forks remain attached
to the original, allowing you to submit a pull request to the original's author to update with
your changes. You can also keep your fork up to date by pulling in updates from the original.
Markdown
Markdown is a simple semantic file format, not too dissimilar from .doc, .rtf and .txt.
Markdown makes it easy for even those without a web-publishing background to write prose
(including with links, lists, bullets, etc.) and have it displayed like a website. GitHub supports
Markdown, and you can learn about the semantics.
Glossary
Pull
Pull refers to when you are fetching in changes and merging them. For instance, if
someone has edited the remote file you're both working on, you'll want to pull in those
changes to your local copy so that it's up to date.
Pull request
Pull requests are proposed changes to a repository submitted by a user and accepted or
rejected by a repository's collaborators. Like issues, pull requests each have their own
discussion forum. For more information, see "About pull requests."
Push
Pushing refers to sending your committed changes to a remote repository, such as a
repository hosted on GitHub. For instance, if you change something locally, you'd
want to then push those changes so that others may access them.
https://help.github.com/articles/github-glossary/
Sign-up
https://github.com
GitHub Desktop
https://git-scm.com/downloads
Install Git (Windows subsystem for Linux)
https://docs.microsoft.com/en-us/windows/wsl/about
NodeJS
Go ahead and visit the node website⁴⁰and download Node. Run through the
installation and you’ll have Node and npm installed!
Mac
git init
git add README.md
git commit -m "first commit"
git remote add origin
https://github.com/shawnmccarthy/we
ek1.git
git push -u origin master
npm Init
Add Packages
Add Config
Build Program
Push to GitHub
git add .
git commit -m "second commit”
git push -u origin master
More Git
CLONE AND WORKING IN TEAMS
Clone a REPO
The GitHub flow is a lightweight, branch-based workflow built around core Git commands used by teams
around the globe—including ours.
The GitHub flow has six steps, each with distinct benefits when implemented:
1. Create a branch: Topic branches created from the canonical deployment branch (usually master) allow
teams to contribute to many parallel efforts. Short-lived topic branches, in particular, keep teams focused and
results in quick ships.
2. Add commits: Snapshots of development efforts within a branch create safe, revertible points in the project’s
history.
3. Open a pull request: Pull requests publicize a project’s ongoing efforts and set the tone for a transparent
development process.
4. Discuss and review code: Teams participate in code reviews by commenting, testing, and reviewing open
pull requests. Code review is at the core of an open and participatory culture.
5. Merge: Upon clicking merge, GitHub automatically performs the equivalent of a local ‘git merge’ operation.
GitHub also keeps the entire branch development history on the merged pull request.
6. Deploy: Teams can choose the best release cycles or incorporate continuous integration tools and operate
with the assurance that code on the deployment branch has gone through a robust workflow.
Hello World Guide
HTTPS://GUIDES.GITHUB.COM/ACTIVITIES/HELLO-WORLD/#REPOSITORY