Giter Club home page Giter Club logo

2023-mexico-git-and-github's Introduction

git

Setup

Warm-Up

  • how to start a repo from scratch?
    • git init local method
    • on GitHub git clone and either git push --force or git pull methods
  • how to revert mistakes?
    • before commit:
      • git restore <file> [discard changes in the working directory] changes files
      • git restore --staged <file> [unstage changes ➔ opposite of git add <file>, does not modify the working directory]
    • after commit:
      • git revert <commit> [creates a new commit, modifies the working directory]
      • git reset <commit> [only reset the HEAD pointer, does not modify the working directory] rewrites history
      • git reset --hard <commit> [reset HEAD and modify working directory] rewrites history and changes files
  • how to move the whole working directory to a specific point in history?
    • git checkout <commit>DETACHED HEAD problem, changes files
    • interaction with branches: git branch <branch_name> + git switch <branch_name>
  • git gui: building commits along the way interactively (for the mess around type of workflows)

The Open Source model

  • remotes: git pull <from_where> <what>, git push <where> <what>, git fetch <from_where> <what>, git merge <another_branch>
  • GitHub: forks, branches and PRs: important ➔ explain fork vs. clone!!!
  • strategies for keeping your fork up-to-date: your main and upstream's main, short-lived and long-lived topic branches
  • a more thorough and detailed explanation can be found on the Numpy Contributor's Guide. This guide can be adapted to your own needs, see gitwash.
  • make it clear that GitHub is just an option (git≠GitHub)

Scenarios

  1. lone scientist working alone in the cellar without Internet (local git)
  2. lone scientist uploading their software to the Internet in the hope it can be useful for other people (local git + one personal GitHub repo)
  3. lone scientist sharing one software project with some other befriended lone scientist working in a different place (local git + o.p.G.r + permissions)
  4. research group sharing software among members (local git + several GitHub repos + permissions + branches + [optional] PRs)
  5. fully distributed software development using the most typical open source software workflows as used by numpy, scipy, sklearn, etc. (like above + we don't trust our contributors, i.e. work strictly with forks)

2023-mexico-git-and-github's People

Contributors

carlos-echeverria avatar otizonaizit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.