You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a bit of trial and beta back and forth GitHub CodeSpaces are now available for free to all GitHub users. CodeSpaces are essentially next step from the web based VS Code editor we've already explored. The addition is that we now also have access to an actual linux terminal.
In this issue:
Start a Code Space
Work from there as if it was your own PC - but in a shared setup
Open a new development branch on an issue - from the command line
Tweak the CodeSpace to your team's standards by adding a .devcontainer configuration
You can see you current CodeSpaces from https://github.com/codespaces This follows the well known GitHub standard, that you access personal information from global URLs - when you are logged in:
👉 You go to Code panel, hit the Code button, Select the CodeSpace tab and then create a CodeSpace 👈
When the CodeSpace is done building you'll see a full fledged IDE environment - it look like the one we explored earlier in the web based editor, only this time you have a genuine linux terminal in the bottom - as if your were on your own machine.
👉 run a few familiar commands; ls, gh, env, cat R<TAB>, git log, az and docker run hello-world 👈
It feels like home eh? Even tab-completion, git, docker, gh is pre-installed. Well the Azure CLI az wasn't installed, but everything else was there.
Let's imagine that we're a development team who agrees that:
👮♀️ You must only make changes that are related to an issue.
👮♀️ Each issue must have its own dedicated development branch.
👮♀️ Work can only be added to the master branch through pull-requests.
If these are rules we should make it easy to follow them.
Now consider, that this issue you're looking at now - #4 instructs you to configure the CodeSpace in a way that ensures that.
The az CLI must be pre-installed
The GitLens VS Code extension by Kraken must be installed
A .gitconfig file must be added in the root of the repo, and it must become active
Let's do all this! it's easy!
👉 In the CodeSpace go to the terminal and run the command listed below: 👈
gh issue develop 4 --checkout
👉 In the command palette find the command that will Add Dev Container configuration 👈
👉 In the list find and install the Azure CLI 👈
👉 In the extension list find and add GitLens, Copilot and Copilot Chat to the Dev Container configuration 👈
👉 Add the line listed below as the second-to-last line in the configuration - just before the last closing bracket }⚠️ remember to add a comma , after the closing bracket above 👈
👉 Add a new file .gitconfig in the root of the repo and let it contain the following: 👈
.gitconf file
[core]editor = nano
[push]default = current
[alias]undo-commit = reset --soft HEAD^
addremove = add -A
recommit = commit -C HEAD --amend
co = checkout
st = status
root = rev-parse --show-toplevel
tree = log --graph --full-history --all --color --date=short --pretty=format:\"%Cred%x09%h %Creset%ad%Cblue%d %Creset %s %C(bold)(%an)%Creset\"backward = checkout HEAD^1
forward = !git checkout $(git log --all --ancestry-path ^HEAD --format=format:%H | tail -n 1)
You may want to test the new Dev Container configuration before you commit it?
👉 In the command palette find the command that will Rebuild Dev Container configuration 👈
👉 Perform some tests - a few ones are suggested below 👈
From the terminal test the following commands
git config --list --show-origin
git tree
az
Open the workflow .yml you created earlier and see that is gives you info about who committed it
Open the .gitconfig file you created - invoke the CoPilot Chat. Ask it to "Add the most commonly used aliases, but don't delete or overwrite any existing settings"
👉 add, commit -m "related to #4" and push the development branch branch 👈
After a bit of trial and beta back and forth GitHub CodeSpaces are now available for free to all GitHub users. CodeSpaces are essentially next step from the web based VS Code editor we've already explored. The addition is that we now also have access to an actual linux terminal.
In this issue:
.devcontainer
configurationYou can see you current CodeSpaces from https://github.com/codespaces This follows the well known GitHub standard, that you access personal information from global URLs - when you are logged in:
https://github.com/issues
https://github.com/settings
https://github.com/notifications
https://github.com/codespaces
Create a new CodeSpace on this repo
Code
panel, hit theCode
button, Select theCodeSpace
tab and then create a CodeSpace 👈When the CodeSpace is done building you'll see a full fledged IDE environment - it look like the one we explored earlier in the web based editor, only this time you have a genuine linux terminal in the bottom - as if your were on your own machine.
ls
,gh
,env
,cat R<TAB>
,git log
,az
anddocker run hello-world
👈It feels like home eh? Even tab-completion, git, docker, gh is pre-installed. Well the Azure CLI
az
wasn't installed, but everything else was there.Let's imagine that we're a development team who agrees that:
👮♀️ You must only make changes that are related to an issue.
👮♀️ Each issue must have its own dedicated development branch.
👮♀️ Work can only be added to the
master
branch through pull-requests.If these are rules we should make it easy to follow them.
Now consider, that this issue you're looking at now - #4 instructs you to configure the CodeSpace in a way that ensures that.
az
CLI must be pre-installed.gitconfig
file must be added in the root of the repo, and it must become activeLet's do all this! it's easy!
}
,
after the closing bracket above 👈...and finally
.gitconfig
in the root of the repo and let it contain the following: 👈.gitconf
fileYou may want to test the new Dev Container configuration before you commit it?
From the terminal test the following commands
Open the workflow
.yml
you created earlier and see that is gives you info about who committed itOpen the
.gitconfig
file you created - invoke the CoPilot Chat. Ask it to "Add the most commonly used aliases, but don't delete or overwrite any existing settings"add
,commit -m "related to #4"
andpush
the development branch branch 👈gh pr create --fill
👈gh browse
and finish the pull request from the web 👈git co master git pull git branch -d 4 # After you've typed '4' use <TAB> to complete the branch name
The text was updated successfully, but these errors were encountered: