Skip to content

Commit

Permalink
➕ git: local clone default branch renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
devmount authored May 31, 2021
1 parent f1937c4 commit 5c33042
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sheets/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ git branch --set-upstream-to=origin/main main
git update-index --assume-unchanged [path]
```

### Rename default branch of local clone

To update a local clone of a repository whose default branch name was changed (e.g. from `master` to `main`):

```bash
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
```

## Remove password prompt

Caution: this will store the password unencrypted on the disk! Only use if it's safe on your machine!
Expand Down

0 comments on commit 5c33042

Please sign in to comment.