function gitOrGitHub()

  1. git init

    'Cuz it's git innit? Use git init to initialize a repository in the current directory. This command creates a hidden .git directory in the current folder containing the git repository and configuration files.

  2. git remote add origin [url]

    After using git init to initialize a repository on the local machine, use this command to link the local repository to an empty remote repository. This allows syncing with GitHub using git push and git pull.

  3. git clone [url]

    Creates a local working copy of the source code from a remote repository. git clone automatically downloads the code and adds the original location as the remote so you can pull code from or push code to it (if you have permission!).

  4. git status

    Shows status of current branch and any changes. Changes not yet staged for commit are displayed in red, staged commits are in green.

  5. git add [filename]

    Adds file(s) to the staging area. Any changes will be included with next commit.

  6. git commit

    Save any changes you've made to your local repository. Each time you commit, you have to include a brief message. This message should include a brief description of the changes made.

  7. git fetch

    Downloads all history from remote tracking branches.

  8. git merge

    Merges remote tracking branches into local branch.

  9. git pull

    Updates local working branch with all new commits from remote branch. (git pull is a combination of git fetch and git merge).

  10. git push

    Uploads all local branch commits to GitHub.