Skip to content

Commit d577c7e

Browse files
authored
Merge branch 'main' into feature/git-remove-local-branches
2 parents 3052205 + 34e0a8b commit d577c7e

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

specs/git/reset_local_branch_to_match_remote_branch.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
---
22
name: Reset local branch to match remote branch
3-
command: "git fetch origin\ngit reset --hard {{branch}}"
3+
command: "git fetch {{remote}}\ngit reset --hard {{remote}}/{{branch}}"
44
tags:
55
- git
66
description: Resets a local branch to match a remote branch by pulling the most recent changes from the remote branch and then force resetting the local branch to match the remote branch.
77
arguments:
8+
- name: remote
9+
description: The name of the remote
10+
default_value: origin
811
- name: branch
912
description: The name of the remote branch that the local branch should be reset to
10-
default_value: origin/master
13+
default_value: master
1114
source_url: "https://stackoverflow.com/questions/1628088/reset-local-repository-branch-to-be-just-like-remote-repository-head"
1215
author: Dan Moulding
1316
author_url: "https://stackoverflow.com/users/95706/dan-moulding"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
# The name of the workflow.
3+
name: Delete newly git-ignored files from your repository
4+
# The corresponding command for the workflow. Any arguments should be surrounded with two curly braces. E.g `command {{arg}}`.
5+
command: |-
6+
git rm -r --cached .
7+
git add .
8+
# Any tags that the workflow should be categorized with.
9+
tags:
10+
- git
11+
# A description of the workflow.
12+
description: After adding new files to the .gitignore file, these commands will update the git index
13+
# The source URL for where the workflow was generated from, if any.
14+
source_url: "https://stackoverflow.com/questions/1274057/how-can-i-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitign"
15+
# The author of the workflow.
16+
author: Matt Frear
17+
# The URL of original author of the Workflow. For example, if this workflow was generated from StackOverflow, the `author_url` would be the StackOverflow author's profile page.
18+
author_url: "https://stackoverflow.com/users/32598/matt-frear"
19+
# The valid shells where this workflow should be active. If valid for all shells, this can be left empty.
20+
# See FORMAT.md for the full list of accepted values.
21+
shells: []

0 commit comments

Comments
 (0)