Github Tricks
Github Tricks
```yaml
name: Branch-Specific Workflow
on:
push:
branches:
- 'main'
```
This ensures that certain workflows, like deployment or CI/CD, only run on specific
branches, making them more targeted.
---
```
git commit -m "Fixes #42: Corrected the bug in the login form"
```
This will automatically link commit `#42` to the related issue and close it if the
phrase "Fixes" or "Closes" is used.
---
---
---
---
### 6. **View a Repository’s File History (Blame)**
You can check the history of a file and see who last modified each line using
**GitHub Blame**. In any file, click on the `Blame` button to see a detailed line-
by-line commit history.
---
---
Example:
```html
<script src="https://gist.github.com/username/gistid.js"></script>
```
This allows you to display code snippets directly on your site, and it auto-updates
when the Gist is updated.
---
---
For example, searching for all issues with the `bug` label would look like this:
```
label:bug is:issue repo:username/repo
```