Git: Getting started - Hansen-Group/HansenWiki GitHub Wiki
Notes on how to use git and github, if you have anything you want added please reach out.
Introduction
The Hansen-phenomics is an organisation account to centralize code development and sharing in the groups. To know more about this type of account visit https://docs.github.com/en/organizations
Resources
There are many resources that ease the process of getting into git and github. Here are some rather useful below
General
https://docs.github.com/en also have a "Get started" chapter that I took a lot from
I made a short pp introduction (located here Q:\Projects\Git_Github) at one of our group meetings see learning_git for code, sorry for some of the Danish, please talk to me before you try it out it is not enterily self-explanatory. I was also much inspired by a coursera cource called "Git + Github for Open Source Collaboration" that I can recommend
R
The "here" package can help setting up a project in R, which uses relative paths. Easing the proces of running code from others pulled from github.
Helper tools
TortoiseGit https://tortoisegit.org/
Functionalities
Transfer ownership
Useful if you want to move a directory to the organisation directory. Settings --> At bottom have "Danger zone" can change ownership.
Security
GDPR
Two factor authentication
https://docs.github.com/en/github/authenticating-to-github/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication
For mobile authentication, you can use the same app (NetIQ advanced authentication) as you use to log on to KUs systems. To set it up just scan the QR code.
Terminology
See detailed terminology overview https://docs.github.com/en/get-started/quickstart/github-glossary
-Branch: A branch is a parallel version of a repository. It is contained within the repository, but does not affect the primary or main branch allowing you to work freely without disrupting the "live" version. When you've made the changes you want to make, you can merge your branch back into the main branch to publish your changes.
-Clone: A clone is a copy of a repository that lives on your computer instead of on a website's server somewhere, or the act of making that copy. When you make a clone, you can edit the files in your preferred editor and use Git to keep track of your changes without having to be online. The repository you cloned is still connected to the remote version so that you can push your local changes to the remote to keep them synced when you're online.
-Commit: A commit, or "revision", is an individual change to a file (or set of files). When you make a commit to save your work, Git creates a unique ID (a.k.a. the "SHA" or "hash") that allows you to keep record of the specific changes committed along with who made them and when. Commits usually contain a commit message which is a brief description of what changes were made.
-Diff: A diff is the difference in changes between two commits, or saved changes. The diff will visually describe what was added or removed from a file since its last commit.
-Forking, Fork a repo: A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.
-Main: The default development branch. Whenever you create a Git repository, a branch named main is created, and becomes the active branch. In most cases, this contains the local development, though that is purely by convention and is not required.
-Master: The default branch in many Git repositories. By default, when you create a new Git repository on the command line, a branch called master is created. Many tools now use an alternative name for the default branch. For example, when you create a new repository on GitHub, the default branch is called main.
-Merge: Merging takes the changes from one branch (in the same repository or from a fork), and applies them into another. This often happens as a "pull request" (which can be thought of as a request to merge), or via the command line. A merge can be done through a pull request via the GitHub.com web interface if there are no conflicting changes, or can always be done via the command line.
-Pull: Pull refers to when you are fetching in changes and merging them. For instance, if someone has edited the remote file you're both working on, you'll want to pull in those changes to your local copy so that it's up to date. See also fetch.
-Pull request: When a developer asks for changes committed to an external repository to be considered for inclusion in a project's main repository.
-Push: To push means to send your committed changes to a remote repository on GitHub.com. For instance, if you change something locally, you can push those changes so that others may access them.
-Repository: A repository is the most basic element of GitHub. They're easiest to imagine as a project's folder. A repository contains all of the project files (including documentation), and stores each file's revision history. Repositories can have multiple collaborators and can be either public or private.
-Status: A visual representation within a pull request that your commits meet the conditions set for the repository you're contributing to.
-User: Users are people with personal GitHub accounts. Each user has a personal profile, and can own multiple repositories, public or private. They can create or be invited to join organizations or collaborate on another user's repository.