Getting started with Git. Check out the CheatSheets and Guides - they're valuable reference material.
- What is Git?
- What is GitHub?
- git add, tracked and untracked files
- git status
- git diff
- git commit
- git remote
- git push
- git pull
- git clone
- README and Markdown
- What are forks?
- What are branches?
- git branch, git checkout
- What is a PR?
- Merging and merge conflicts
- Open Source Contributions
- GitHub Pro (Student Pack)
- Your own website!
We'll be learning some important concepts using this repository. Follow the instructions below.
- Fork this repository - this creates your-username/GitStarted, which is like your copy of this repository. Forks are not automatically updated. To fork, press the
Forkbutton at the top. - Create a local clone of the repository. This means you download the repository onto your system, to have a local clone or copy of it. You can make changes to the files here and later commit and push these changes. Use
git clone https://github.com/your-username/GitStarted.git. - Check
git remote, and you should seeorigin. This remote points to your fork of this GitHub repository. Now, add a remote pointing to this repository, calledupstreamusinggit remote add upstream https://github.com/ssncsegithub/GitStarted. - Pull any changes made to this repository using
git pull upstream master, to synchronize your local and retrieve any new changes made. - Checkout to a new branch using
git checkout -b new-branch-name. This is done so that your experimental changes are kept separate frommasterwhich is stable. - Add your name to the
Names.mdfile in Markdown syntax, and link to your GitHub profile. Make these changes locally. - Once you're happy, commit and push these changes. You will be pushing the changes to your GitHub repostory's branch using
git push origin new-branch-name. - Go to your fork on GitHub and click
New Pull Request. Edit the details and submit the PR. - Wait for it to be merged. Once merged, delete your new branch on GitHub (this can be done from the PR using a shortcut). Locally, checkout to
masterand usegit branch -D new-branch-name. - Pull changes fom
upstream, push toorigin master.