Skip to content
Snippets Groups Projects
Select Git revision
  • bece892e743d2b153eb3dcddfedf314a9c62b273
  • master default protected
  • development
  • marco/aquacrop-regional-params
  • precompile-statements
  • precompile-tools
  • tmp-faster-loading
  • skylark
  • testsuite
  • code-review
  • v0.7.0
  • v0.6.1
  • v0.6.0
  • v0.5.5
  • v0.5.4
  • v0.5.3
  • v0.5.2
  • v0.2
  • v0.3.0
  • v0.4.1
  • v0.5
21 results

search_index.js

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    basics.html 18.50 KiB
    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8" />
        <meta name="author" content="Dirk Sarpe and Christian Krause" />
        <title>git basics</title>
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        <link rel="stylesheet" href="reveal.js/css/reveal.css" />
        <link rel="stylesheet" href="reveal.js/lib/css/zenburn.css" />
        <style type="text/css">code{white-space: pre;}</style>
        <link rel="stylesheet" href="reveal.js/css/theme/black.css" id="theme" />
        <link rel="stylesheet" href="css/ribbon.css" />
      </head>
    
      <body>
        <div class="reveal">
          <div class="slides">
    
            <!---------------------------------------------------------------------
            <!-- intro
            <!-------------------------------------------------------------------->
    
            <section>
              <section id="title" data-markdown>
                # git basics
                ## for beginner-level git users
    
                notes:
                - if you have questions ask them right away
                - hand out cheat sheets later, no need to write stuff down
              </section>
    
              <section id="intro-objectives" data-markdown>
                ## objectives
    
                - teach you to fish
                - hands-on experience
                - use version control!
                - collaborate!
              </section>
    
              <section id="intro-about-today" data-markdown>
                ## about today
    
                be able to ...
    
                1.  use git in **ALL** your projects
                2.  collaborate with each other
    
                ... is mission accomplished.
    
                notes:
                - there is time for fancy stuff later
                - take a few weeks getting used to git
                - delay is good to grow your own experience
                - growing pain is how we learn
              </section>
    
              <section id="intro-about-me" data-markdown>
                ## about me
    
                - scientific computing support @ idiv since 2014
                - happy git user since 2010
    
                > There will never be a better version control system than git.
                >
                > -- Christian Krause, Chemnitz 2017
              </section>
    
              <section id="intro-about-you" data-markdown>
                ## about you
    
                ![people](img/people.jpg)
    
                name, job, git experience, why git?
              </section>
            </section>
    
            <!---------------------------------------------------------------------
            <!-- motivation
            <!-------------------------------------------------------------------->
    
            <section>
              <section id="motivation" data-markdown>
                # motivation
    
                > Why should I use git?
              </section>
    
              <section id="motivation-avoid-mess" data-markdown>
                ## motivation #1
                ### avoid mess
    
                ![blah](img/draft_mess.png)
    
                notes:
                - who has seen such a mess?
                - who has contributed to such a mess?
                - who has created such a mess?
              </section>
    
              <section id="motivation-want-structure" data-markdown>
                ## motivation #1
                ### want structure
    
                ![blah](img/gitk-pretty-history.png)
    
                notes:
                - TODO better repo with more contributors
                - structure
                - who, when, why
              </section>
    
              <section id="motivation-want-structure" data-markdown>
                ## about git
    
                1.  **records changes to a *repository***
    
                    content, who, when, why
                2.  **best tool for the job**
    
                    technical, usability, community
    
                notes:
                - the fact that content is organized in files and directories is
                  only incidental
                - for git to be useful, content has to be text
              </section>
    
              <section id="motivation-playground" data-markdown>
                ## motivation #2
                ### throw-away playgrounds
    
                ![playground](img/motivation-throwaway-playground.svg)
    
                notes:
                - test stuff without interfering
                  - throw away if garbage
                  - integrate if good
                - switch back and forth
                - (done right) decision based on regression testing
              </section>
    
              <section id="motivation-collaboration-1" data-markdown>
                ## motivation #3
    
                ![boy scout rule](img/boy-scout-rule.jpg)
    
                notes:
                - there's a rule in open source software ...
                - at least open issue
                - if trivial to fix: do it!
              </section>
    
              <section id="motivation-collaboration-2" data-markdown>
                ## motivation #3
                ### collaboration made easy
    
                <!-- do not fix this typo, it's here on purpose to show collab -->
                > This text cuntains a typo.
    
                notes:
                - demo GitLab
                  - [go to project](https://git.idiv.de/sc/edu/git-seminar)
                  - check if typo still in master
                  - edit
                  - change **target branch** to create merge request
                - commit message:
                    ```
                    fixes typo
    
                    learn how to use a spell checker
                    ```
              </section>
    
              <section id="motivation-creative-use" data-markdown>
                ## motivation #4
                ### the creative use of git award
                #### goes to Michael Schilli
    
                ```yml
                videos:
                  - id: '_3i5yVoTvCs'
                    title: 'How to flip German pancakes'
                  - id: 'brPfE66FC24'
                    title: 'Tivo Stream Cooling Fan Replacement'
                ```
    
                ```console
                $ youtube-sync -i videos.yml
                _3i5yVoTvCs: Unchanged
                brPfE66FC24: Updated OK
                ```
    
                source: [Linux Magazin](http://www.linux-magazin.de/) 2018/01
              </section>
    
              <section id="motivation-use-everywhere" data-markdown>
                ## motivation #e
                ### use version control for
                # *everything*
    
                | common       | less frequent   | esoteric?       |
                | ------------ |:---------------:| ---------------:|
                | software     | presentation    | youtube         |
                | blog         | paper / thesis  | soundboard      |
                | user config  | task management | drinking games  |
    
                notes:
                - if it doesn't support git don't use it
              </section>
    
              <section id="motivation-automation" data-markdown>
                ## motivation #a
                ### automation
    
                - software testing
                - code quality
                - build app and deploy to app store
                - put presentation on web server
    
                *(see advanced seminar)*
    
                notes:
                - basically, everything you can script
              </section>
            </section>
    
            <!---------------------------------------------------------------------
            <!-- basic command line usage
            <!-------------------------------------------------------------------->
    
            <section>
              <section id="setup" data-markdown>
                # setup
    
                notes:
                - git is simple and complex
                - git seems complex for 2 reasons:
                  - you're unfamiliar with command line
                  - there are a lot of choices
                - only X (TODO) theory/internals pages
                - I'm gonna dumb it down for you
                  - aka we'll stick to the simple parts
              </section>
    
              <section id="setup-cli" data-markdown>
                ## command line
    
                - Ellen Ripley uses command line
                - Chuck Norris uses command line
              </section>
    
              <section id="setup-os-packages" data-markdown>
                ## os packages
    
                - **Linux:** bash and git
                - **Mac:** bash and git
                - **Windows:** cmder
              </section>
    
              <section id="cli-description" data-markdown>
                ## command line
                ### description syntax
    
                ```bash
                # command
                git
    
                # sub-command
                git status
    
                # optional
                git diff [--staged]
                ```
              </section>
    
              <section id="cli-git" data-markdown>
                ## command line
                ### git syntax
    
                ```bash
                # every git command
                git command [arguments]
    
                # get help
                git help [command]
                ```
              </section>
    
              <section id="setup-git" data-markdown>
                ## git setup
    
                ```bash
                # configure your identity
                git config --global user.name  'Jane Doe'
                git config --global user.email 'jane.doe@riot-grrrl.org'
    
                # show colors
                git config --global color.ui auto
    
                # editor
                git config --global core.editor emacs
    
                # configure aliases
                git config --global alias.unstage 'reset HEAD --'
                git config --global alias.lol \
                  'log --graph --decorate --oneline --all'
                ```
              </section>
            </section>
    
            <!---------------------------------------------------------------------
            <!-- basic command line usage
            <!-------------------------------------------------------------------->
    
            <section>
              <section id="cli-basic" data-markdown>
                # git command line
                ## local repositories
              </section>
    
              <section id="cli-create-repository" data-markdown>
                ## command line
                ### create repositories
    
                ```bash
                # create empty repository
                git init project-name
    
                # create repository from existing project
                # which is not under version control
                cd path/to/project
                git init
                ```
              </section>
    
              <section id="cli-git-status" data-markdown>
                ## command line
                ### git status
    
                ```bash
                # show status and what to do
                git status
                ```
    
                notes:
                - important git command
                - shows a lot of information
                - shows basic git commands
                - later, we'll see different outputs
              </section>
    
              <section id="internals-staging-area" data-markdown>
                ## internals
                ### the staging area
    
                ![staging area](img/staging-area.svg)
              </section>
    
              <section id="cli-git-files" data-markdown>
                ## command line
                ### file handling
    
                ```bash
                # use staging area
                git stage file
                git unstage file
    
                # discard changes
                git checkout file
    
                # rename and remove
                git mv source destination
                git rm file
                ```
              </section>
    
              <section id="cli-git-diff-1" data-markdown>
                ## command line
                ### show changes
    
                ```bash
                # from staging area to current working copy
                git diff
    
                # show contents of staging area, i.e.
                # from last commit to staging area
                git diff --staged
                ```
              </section>
    
              <section id="cli-git-commit" data-markdown>
                ## command line
                ### commit changes
    
                ```bash
                # opens editor for you to edit commit message
                git commit
    
                # commits with a short message
                git commit -m 'adds license and readme'
                ```
              </section>
    
              <section id="commit-message-conventions" data-markdown>
                ## TODO
              </section>
    
              <section id="cli-git-log" data-markdown>
                ## command line
                ### view history
    
                ```bash
                # show all commits
                git log
    
                # show all commits plus diff
                git log --patch
    
                # shows condensed view of history, i.e.
                # - only commit message subjects
                # - one per line
                git lol
                ```
              </section>
    
              <section id="cli-demo-basic" data-markdown>
                ## demo
                ### basic commands
    
                notes:
                - mkdir ~/projects
                - git init hello
                - README.md
                - LICENSE
                - src/hello.py
              </section>
    
              <section id="licenses-software" data-markdown>
                ## software licenses
    
                ![software licenses](img/license-chooser.svg)
    
                https://choosealicense.com
              </section>
    
              <section id="licenses-none" data-markdown>
                ## no license
    
                - exclusive copyright to **each!** author
                - **no one** can use, copy, distribute and modify
                - platform: terms of service
    
                https://choosealicense.com
              </section>
    
              <section id="licenses-other" data-markdown>
                ## other licenses
    
                - media, documentation: creative commons
                - paper / thesis: journal vs legal department
    
                https://choosealicense.com
              </section>
    
              <section id="cli-cheatsheet" data-markdown>
                # [cheat sheet](https://idiv-biodiversity.github.io/git-cheat-sheet/)
              </section>
    
              <section id="cli-your-turn" data-markdown>
                # your turn
    
                - pick project
                - make commits
                - use status and diff!
    
                notes:
                - deputize those who already have
              </section>
            </section>
    
            <section id="break" data-markdown>
              # break
            </section>
    
            <!---------------------------------------------------------------------
            <!-- distributed
            <!-------------------------------------------------------------------->
    
            <section>
              <section id="distributed" data-markdown>
                # distributed
                ## version control system
              </section>
    
              <section id="distributed-local" data-markdown>
                ## git usage until now
    
                - has all been local
                - repo contains entire project history
                - not yet answered:
                  - how to publish?
                  - how to contribute?
              </section>
    
              <section id="distributed-remotes" data-markdown>
                ## remotes
    
                ![remotes](img/git-remote-solo.svg)
              </section>
    
              <section id="distributed-webapps" data-markdown>
                ### how do i get remotes?
                # web apps
    
                - GitLab demo
                - GitHub (no demo)
              </section>
    
              <section id="distributed-remote-clone" data-markdown>
                ## command line
                ### clone repositories
    
                ```bash
                # create local copy of existing repository
                git clone https://github.com/user/project-name.git
                ```
              </section>
    
              <section id="distributed-your-turn" data-markdown>
                ## your turn
    
                - log in
                - create project
                - fetch / push / pull
              </section>
            </section>
    
            <!---------------------------------------------------------------------
            <!-- collaboration
            <!-------------------------------------------------------------------->
    
            <section>
              <section id="collab" data-markdown>
                # collaboration
              </section>
    
              <section id="collab-" data-markdown>
                ## command line
                ### git 
    
                ```bash
                
                ```
              </section>
    
              <section id="collab-" data-markdown>
                ## command line
                ### git 
    
                ```bash
                
                ```
              </section>
            </section>
    
            <section>
              <section id="homework" data-markdown>
                # homework
              </section>
    
              <section id="homework-use-git" data-markdown>
                ## homework #1
                ### use git
    
                for each project you use ...
    
                ... create repository in GitLab ...
    
                ... and commit changes!
              </section>
    
              <section id="homework-collaborate" data-markdown>
                ## homework #2
                ### collaborate
    
                - talk with your colleagues
                - organize project(s) you use together
                  - open issues for problems and features
                  - contribute via merge requests
                  - review commits and merge requests
              </section>
    
              <section id="homework-behavior" data-markdown>
                ## homework #3
    
                be friendly
    
                be responsible
    
                be open
    
                be creative
    
                be proactive
    
                have fun
              </section>
            </section>
    
            <section id="eof" data-background="img/trex.png">
              <h1>EOF</h1>
            </section>
          </div>
        </div>
    
        <!-- ribbon -->
    
        <div class="ribbon-wrapper right">
          <div class="ribbon">
            <a href="https://git.idiv.de/sc/edu/git-seminar">
              edit
            </a>
          </div>
        </div>
    
        <!-- reveal.stuff -->
    
        <script src="reveal.js/lib/js/head.min.js"></script>
        <script src="reveal.js/js/reveal.js"></script>
    
        <script>
          Reveal.initialize({
            controls: true,
            progress: true,
            slideNumber: true,
            history: true,
            center: true,
            keyboard: true,
            maxScale: 1.5,
            slideNumber: false,
            theme: Reveal.getQueryHash().theme,
            transition: Reveal.getQueryHash().transition || 'default',
    
            dependencies: [
              { src: 'reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } },
              { src: 'reveal.js/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
              { src: 'reveal.js/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
              { src: 'reveal.js/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
              { src: 'reveal.js/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
              { src: 'reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
            ]
          });
        </script>
      </body>
    </html>