NOT PORTED YET
- GitHub Skills Training
- Access
- Git Clone over HTTPS using API Token
- Pull Requests
- CodeOwners
- GitHub Profile Page
- Use Permalink URL References for Documentation or Support Issues
- Analyze GitHub Repos
- Memes
Generate your token here:
https://github.com/settings/tokens
Generate an SSH key:
ssh-keygen(see SSH page for more options)
Then upload the public key here:
https://github.com/settings/keys
If you're using SSH keys to git clone in a company using GitHub SSO authentication then you will need
to authorize your SSH keys for each organization in order to be able to use them.
On this page listing your SSH keys:
https://github.com/settings/keys
On the right of each key, click the Configure SSO drop-down and then next to the organizations you're a member of
click Authorize.
Cloning with HTTPS then becomes:
git clone "https://GITHUB_TOKEN@github.com/$ORG/$REPO.git"or better using a credential helper...
Taken from my .gitconfig:
[credential "https://github.com"]
# without the "sleep 1" the Git command may miss catching the output and hang instead
helper = "!f() { sleep 1; echo \"username=${GITHUB_USER}\"; echo \"password=${GH_TOKEN:-${GITHUB_TOKEN}}\"; }; f"
[credential "https://gist.github.com"]
helper = "!f() { sleep 1; echo \"username=${GITHUB_USER}\"; echo \"password=${GH_TOKEN:-${GITHUB_TOKEN}}\"; }; f"git clone "https://github.com/$ORG/$REPO.git"If you get a 401 or 403 authentication or authorization error, you can check Git debug output by setting:
export GIT_CURL_VERBOSE=1Use Pull Requests to track changes and get peer review and approval.
Keep PRs as small and atomic as possible -
people's eyes will glaze over on big PRs resulting in lgtm approvals out of fatigue,
missing bad code or bugs into the repo and defeating
the quality control of peer review.
The more lines in a PR, there more likely your colleagues will miss something.
Hopefully your more thorough 'rainman' coding bro comes along and revokes the approval.
HariSekhon/Templates - .github/CODEOWNERS
Enforce Pull Request reviews to all or given paths in the repo to this list of users or teams.
Auto-notifies these code owners requesting reviews when pull requests changing their files are raised.
When listing GitHub teams in the .github/CODEOWNERS file, the team must not be set to Secret otherwise it won't be
respected, on top of it requiring Write access to the repo.
Create a GitHub repo with the same name as your GitHub profile username and in it create a README.md file
which will be automatically displayed as your GitHub profile home page.
You can do anything you normally can in Markdown - links, formatting, using HTML and embedding 3rd party tools like:
| URL | Description |
|---|---|
| https://shields.io | Badges |
| https://komarev.com/ghpvc/ | Profile hits counter |
| Profile Stats or GitHub repos to list more repos than that annoying arbitrary 6 repo pin limitation |
See my GitHub Home Profile page:
which comes from this repo:
GitLab uses this too but it puts a Read more link instead of displaying the whole page like GitHub.
When referencing GitHub lines or HTML anchors in Documentation or support issues, use a permalink URL instead of the default branch link, which can change and misdirect your line number or anchor references.
A permalink uses the commit hashref so that it always goes to that fixed line or anchor in history.
Press y on a page while browsing GitHub.com to change the current branch URL to a permalink hashref commit URL.
(formerly Black Duck Open Hub)
Gives lines of code and ode quality metrics like maintainability, security vulnerabilities, and technical debt.
You can see badges for this across my public GitHub repos.
gem install github-linguistlinguist /path/to/repoCounts lines of code vs comments vs blanks.
Install on Mac:
brew install clocInstall on Debian / Ubuntu:
sudo apt install clocRun it against a directory of code to count the lines of code:
cloc /path/to/git/checkout
cloc ~/github/bash-toolsgithub.com/AlDanial/cloc v 2.02 T=3.16 s (1084.1 files/s, 260706.2 lines/s)
---------------------------------------------------------------------------------
Language files blank comment code
---------------------------------------------------------------------------------
JSON 33 5 0 528324
Bourne Shell 1594 26338 38702 70205
YAML 885 6568 29712 41929
HCL 192 3965 4595 16567
Markdown 70 3964 321 13016
Text 56 323 0 5004
SQL 233 862 5533 4182
Groovy 140 924 4122 3933
Bourne Again Shell 97 1219 3904 2337
XML 24 9 9 1490
make 21 352 373 1320
INI 12 148 0 804
Maven 1 62 68 342
Python 7 108 401 235
Perl 5 67 74 230
m4 5 55 3 216
Go 1 12 20 97
Ruby 13 16 247 81
Dockerfile 1 66 181 78
Properties 8 54 133 77
Java 4 31 54 63
Scala 4 27 69 42
Gradle 2 13 60 39
Jinja Template 1 2 0 33
JavaScript 3 31 152 30
Expect 2 5 15 22
Puppet 3 7 61 20
ASP 1 4 1 11
SVG 6 0 0 6
C 1 3 6 3
zsh 1 1 13 3
PHP 1 3 6 2
DOS Batch 1 2 5 1
Visual Basic Script 1 3 5 1
Pig Latin 1 2 14 0
---------------------------------------------------------------------------------
SUM: 3430 45251 88859 690743
---------------------------------------------------------------------------------
Script in DevOps-Bash-tools to count lines across all public original GitHub repos:
github_public_lines_of_code.shAren't you lucky this isn't me...
Disclaimer: seriously, don't get married, you can't control the forking today.
Don't approve your own pull requests.










