Git/Github Workshop

Git/Github Workshop

Git/Github workshop given at Charlotte Front-End Developers. The workshop covers getting GIT installed on Mac/Windows/Linux the digs through the bare necessity that you'll need to work with GIT. Towards the end it covered workflow, how to work with Github and these magical things called pull requests.

7559f6cff1f5efc2d210965febd4d71c?s=128

Bermon Painter

March 31, 2014
Tweet

Transcript

  1. 1.
  2. 18.
  3. 27.
  4. 41.

    $ git status Status Check List all of the changes

    that have  been made but not committed.
  5. 43.

    $ git add <filename>.txt Add Changes Adds an individual file

    and stores them in the Index until you’re ready to commit.
  6. 47.
  7. 49.

    $ git log --pretty=oneline Logs Lists the recent history of

    a repo in a slightly more readable format.
  8. 50.

    $ git log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short

    Logs Lists the recent history of a repo in  an extremely more readable format.
  9. 51.

    $ git log --graph -- pretty=format:'%Cred%h%Creset - %C(yellow)%d%Creset %s %Cgreen(%cr)

    %C(bold blue)<%an> %Creset'--abbrev-commit -- date=relative Logs Lists the recent history of a repo in  an extremely more readable format.
  10. 53.

    $ git remote add origin <server url> Adding Remotes Useful

    for adding a remote to a new GIT repo.
  11. 54.

    $ git remote add <remote name> <server url> Adding Multiple

    Remotes Creates another remote that  you can pull and push too.
  12. 56.

    $ git push origin master Push Your Changes Pushes your

    changes to the remote. Typically a server or service like Github. Origin is an alias to a URL. Master is simply the default branch.
  13. 58.

    $ git pull origin master Pulling Changes A pull is

    two GIT commands in one. It will fetch changes from the remote, then attempt to merge them into your local repo.
  14. 59.
  15. 63.

    $ git checkout master $ git merge <branch name> Branches

    Merge a branch back into your master branch.
  16. 69.

    $ git checkout -b <branch-name> <id00000> Revert Commits Detach you

    from what’s in HEAD and create a new branch
  17. 70.

    $ git stash $ git reset --hard <id000000> $ git

    stash pop Revert Commits Stash your current changes and then reset.
  18. 72.
  19. 73.

    $ pico ~/.gitconfig Aliases Aliases are stored in a global

     .gitconfig file in your $HOME folder.
  20. 74.

    [alias] ci = commit cm = commit -am br =

    branch co = checkout lp = log -p who = shortlog -n -s --no-merges undo = reset --hard lc = log ORIG_HEAD.. --stat --no-merges lg = log --graph --pretty=format:'%Cred%h%Creset - %C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative lf = log --pretty=fuller cleanup = !git gc && git remote prune origin fork = remote add -f Aliases
  21. 76.
  22. 77.