Top GitHub features you should start using today!
Github has tones of features to improve the developer experience. Below are a few ones that I think everyone should know!
(Note: These are just like quick pointers you can explore in detail each topic separately! )
1) Open Any repository in GitHub VsCode
GitHub has made it easy to open any repository to be directly edited in the cloud.
Just change the domain from github.com to github.dev and voila your whole repo will open as VSCode in the browser! So no more file only view.
eg.
https://github.com/<yourname>/<repository>
Change to
https://github.dev/<yourname>/<repository>
and the result, A full fledge VSCode experience right inside your browser! You can use most of the VSCode shortcuts there like quick jump cmd + p or ctrl + p
More info here https://github.com/features/codespaces
(Note: Actions won’t allow you to run your code as there is no compute associated. You can review GitHub Codepsaces which has a pricing policy)
2) GitHub Actions:
GitHub Actions makes it easy to automate all your software workflows, It lets you Build, test, and deploy your code right from GitHub.
Just define a workflow and deploy your code. Github actions will take care rest for you. You can add tests, CI/CD checks, and much more.
Simple Github actions for deploying a node app. (Example from official docs https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs)
name: Node.js CIon:
push:
branches: [ main ]
pull_request:
branches: [ main ]jobs:
build: runs-on: ubuntu-latest strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x] steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
3) Do you know GitHub supports keyboard shortcuts?
Yes. Github has a handy set of shortcuts that will allow you to navigate the site faster and more efficiently!
eg. Quick navigation to search bar? Simply press “S”
Github also does support a lot of code editing shortcuts like those below. (Make sure you have opened a file from a repo for the below shortcuts to work )
T Activates the file finder
L Jump to a line in your code
W Switch to a new branch or tag
Y Expand a URL to its canonical form. For more information, see “Getting permanent links to files.”
I Show or hide comments on diffs. For more information, see “Commenting on the diff of a pull request.”
A Show or hide annotations on diffs
B Open blame view. For more information, see “Tracing changes in a file.”
More Shortcuts here: https://docs.github.com/en/get-started/using-github/keyboard-shortcuts
and there are more like GitHub Issues, GitHub Wiki, GitHub Copilate, and so on….. Head over to official docs and you will find many.
https://docs.github.com/en