Git
Git Cheat Sheet
Contributing to an Open Source Project
Follow these steps to contribute to an open source repository on GitHub:
Fork the repository
- Navigate to the repository on GitHub.
- Click on the Fork button in the top-right corner. This creates a copy under your account.
Clone your fork locally
git clone https://github.com/your-username/repository-name.gitReplace
your-usernameandrepository-namewith your GitHub username and the project name.Create a new branch for your changes
git checkout -b feature/my-featureMake changes and stage them
git add .Commit your changes
git commit -m "Explain your feature or fix"Push your branch to your fork
git push origin feature/my-featureCreate a Pull Request (PR)
- On GitHub, navigate to your fork.
- Click Compare & pull request.
- Provide a clear title and description, then submit the PR.
Pushing Without Triggering CI/CD Actions (Windows / Linux)
Use special keywords in your commit message to prevent automated pipelines (like GitHub Actions) from running for that specific push:
Prepare all modified files to be committed:
git add .Create the commit, adding a specific keyword phrase to the commit message. Common keywords include [skip ci], [ci skip], [no ci], [skip actions], or [actions skip]:
git commit -m "Your commit message [skip ci]"Upload your commit(s) to the main branch on the remote named origin:
git push origin mainact - Run your GitHub Actions locally (Windows)
Use act to run your GitHub Actions locally for fast feedback without pushing changes.
Download the binary Download the latest release binary for Windows from the nektos/act releases page.
Install Docker Install Docker Desktop for Windows.
actuses Docker containers to simulate the GitHub Actions environment.Setup the executable
- Save the binary in a dedicated directory, for example:
C:\Users\<your-username>\.act. - Add this directory path to your Windows Environment Variables under
Path.
- Save the binary in a dedicated directory, for example:
Run the tool Open PowerShell, navigate to your git repository’s root directory, and execute the command:
actIf your workflow relies on secrets or environment variables, you can pass them to act using flags or files:
- Run with a secrets file
Create a file (e.g.,.secrets) containing your keys inKEY=VALUEformat, then run:act --secret-file .secrets - Run with manual secrets
Inject a specific secret directly in the command line:act -s MY_SECRET=somevalue - Run with environment variables
act automatically looks for a.envfile in the current directory. To specify a custom file:act --env-file .env
- Run with a secrets file