Skip to content

microsoft/MTC_IL_WORKSHOP_Github_Actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

Github actions deep dive workshop from zero to hero

Git Basic Commands

After installing Git, you can also configure it - most importantly, you can set a username and email address that will be connected to all your code snapshots.

You can learn more about Git's configuration options here: https://docs.craft.do/editor/d/93958d6f-1340-6147-fc3c-1be83d5bfef9/FE067BAC-75E9-40A9-9280-5125A1823AB4/b/7DF294EA-9ABC-40FD-8DD5-E9527B89FF29#50E78A39-91C6-4063-87FA-104A42C4C8BE

git config --global user.name "your-username"
git config --global user.email "your-email"
git init # Create git directory 
git add <file(s)> # Stage changes for next commit 
git add . # Add all files
git commit -m "message" # Create a commit that includes all stages changes 
git log # show the Head and commit history
git status # get the current repository status
git checkout <id> # Move between commits 
git checkout main # Go to latest commit in main branch 

Reverting changes with "git revert"

git revert <id> # Undo Commits - Revert changes of commit by creating a new commit 

Resetting code with "git reset"

git reset --hard <id> # Undo changes by deleting all commits since <id>

Branches

git branch <name> # Create a new branch 
git branch -b <branch-name> # Create a new branch and checkout to newly created branch 
git checkout <branch-name> # Move to new created branch 
git branch -D <branch-name> # Delete branch 
git branch # See all branches
git merge <name> # Merge branches
# Merge from feature branch to main branch 
git checkout main 
git merge feature-restructure 
git branch -D feature-restucture # delete the feature branch

Forks

You can fork the repository and then pull request between different repositories, You need to create a pull request from the original repository and connect to your forked repository.

GitHub actions basic

workflows_jobs_steps

workflows_jobs_steps

First Workflow

name: First Workflow
on: workflow_dispatch # manually trigger the workflow

jobs:
  first-job:
    runs-on: ubuntu-latest
    steps:
      - name: Print greeting 
        run: echo "Hello World"
      - name: Print goodbye
        run: echo "Done - bye"

If you need to run multiple shell commands (or multi-line commands), you can easily do so by adding the pipe symbol ( | ) as a value after the run: key.

Example:

...
run: |
    echo "First output"
    echo "Second output"

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published