https://github.com/thinkverse/merge-via-cli
Testing merging via CLI
https://github.com/thinkverse/merge-via-cli
git-merge github-cli how-to
Last synced: 9 months ago
JSON representation
Testing merging via CLI
- Host: GitHub
- URL: https://github.com/thinkverse/merge-via-cli
- Owner: thinkverse
- License: mit
- Created: 2020-08-29T10:57:43.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-29T11:29:59.000Z (over 5 years ago)
- Last Synced: 2025-01-23T10:13:10.684Z (11 months ago)
- Topics: git-merge, github-cli, how-to
- Language: HTML
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🧙♂️ Testing merging branched via CLI
I've never tested this before actually... huh, that was easy. 🤘
---
## Using github-cli ([cli/cli])
First lets create a new branch to add our LICENSE.
```bash
master > git checkout -B branch-01
```
After we've added our LICENSE, let's create a PR and pre-fill our title and description with our commits.
```bash
branch-01 > gh pr create --fill
```
Then let's merge that PR with `merge`, github-cli will merge to our requested branch `master` and take care of the clean up both locally and remote and delete `branch-01`
```bash
branch-01 > gh pr merge
```
Now locally we have been moved back into our `master` branch.
```bash
master > .
```
---
## Using regular git
Our steps are exactly the same expect we're using regular git, so let's create our new branch.
```bash
master > git checkout -B branch-02
```
Then to merge we go to the branch we wanna merge into, in this case `master`
```bash
branch-02 > git checkout master
```
To merge into our branch we use the `merge` command and add the branch we want to merge into master, in this case `branch-02`
```bash
master > git merge branch-02
```
Now we can push our changes to remote.
```bash
master > git push origin master
```
Now we have to do the clean-up on remote and local ourselves, so let's push a delete request to our remote `branch-02` branch, and delete it locally.
```bash
master > git push --delete origin branch-02
master > git branch -D branch-02
```
[cli/cli]: https://github.com/cli/cli