Skip to content

Commit

Permalink
Update no_push post with more info.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdepillabout committed Jan 5, 2022
1 parent 409600f commit eb37b2d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions 2021-12-15-git-no_push.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,21 @@ a command like this:
```console
$ git push -v [email protected]:NixOS/nixpkgs.git HEAD
```

You can also explicitly set the `pushRemote` for a single branch. This will
allow you to directly push that given branch (but no other branches). The
easiest way to set this up is directly through the `.git/config` file. Add an
entry for the branch that looks similar to the following:

```console
$ cat .git/config
...
[branch "haskell-updates"]
remote = origin
pushRemote = [email protected]:NixOS/nixpkgs.git
merge = refs/heads/haskell-updates
...
```

This makes it so that when the `haskell-updates` branch is checked out, you can
run `git push` and it automatically pushes to `[email protected]:NixOS/nixpkgs.git`.

0 comments on commit eb37b2d

Please sign in to comment.