Skip to content

Commit

Permalink
📝 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Alecton4 committed Aug 11, 2023
1 parent 058d005 commit 0caf6e3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
31 changes: 31 additions & 0 deletions notes_OS/cross-platform/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ This note contains configuration related tips. See [[notes_development/git]] for
- [Specify how to reconcile divergent branches](#specify-how-to-reconcile-divergent-branches)
- [GitHub configuration](#github-configuration)
- [Add SSH key to GitHub](#add-ssh-key-to-github)
- [墙国专属](#墙国专属)
- [Change `hosts`](#change-hosts)
- [Set proxy](#set-proxy)
- [Linux](#linux)
- [Other methods](#other-methods)

## Local configuration

Expand Down Expand Up @@ -61,6 +66,32 @@ fatal: Need to specify how to reconcile divergent branches.
1. Generate a key. See [[SSH#Generate SSH key]].
2. Refer to [the GitHub guide](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).

## 墙国专属

### Change `hosts`

Get `hosts` from the following sites:

- https://github.com/521xueweihan/GitHub520
- https://github.com/ineo6/hosts
- https://ineo6.github.io/hosts/
- https://github.com/isevenluo/github-hosts

### Set proxy

#### Linux

*References*:

- [Configure Git to use a proxy](https://gist.github.com/evantoli/f8c23a37eb3558ab8765)
- [Configure Git to use a proxy (https or SSH+GIT)](https://gist.github.com/ozbillwang/005bd1dfc597a2f3a00148834ad3e551)

### Other methods

*References*:

- https://github.com/dotnetcore/FastGithub

[//begin]: # "Autogenerated link references for markdown compatibility"
[notes_development/git]: ../../notes_development/git.md "Git Tips"
[SSH#Generate SSH key]: remote/SSH.md "SSH Usage"
Expand Down
35 changes: 2 additions & 33 deletions notes_development/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@ This note contains operation related tips. See [[cross-platform/git]] for config
- [Discard unstaged changes](#discard-unstaged-changes)
- [Stash changes](#stash-changes)
- [Rename branch](#rename-branch)
- [Change repo remote origin](#change-repo-remote-origin)
- [Change remote origin](#change-remote-origin)
- [Hard reset remote branch](#hard-reset-remote-branch)
- [Private fork](#private-fork)
- [墙国专属](#墙国专属)
- [Change `hosts`](#change-hosts)
- [Set proxy](#set-proxy)
- [Linux](#linux)
- [Other methods](#other-methods)

## Commit message convention

Expand Down Expand Up @@ -75,7 +70,7 @@ Use `git fetch REMOTE_REPO REMOTE_BRANCH:LOCAL_BRANCH`.
- Rename checked-out local branch: Use `git branch --move NEW_BRANCH_NAME`.
- Rename unchecked-out local branch: Use `git branch --move BRANCH_NAME NEW_BRANCH_NAME`.

## Change repo remote origin
## Change remote origin

Use `git remote set-url REMOTE_NAME NEW_URL`.

Expand Down Expand Up @@ -127,32 +122,6 @@ After hard resetting the local repo, use `git push -f REMOTE_REPO BRANCH_NAME` t
- [Create a private fork of a public repository](https://gist.github.com/0xjac/85097472043b697ab57ba1b1c7530274)
- [Duplicating a repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/duplicating-a-repository)

## 墙国专属

### Change `hosts`

Get `hosts` from the following sites:

- https://github.com/521xueweihan/GitHub520
- https://github.com/ineo6/hosts
- https://ineo6.github.io/hosts/
- https://github.com/isevenluo/github-hosts

### Set proxy

#### Linux

*References*:

- [Configure Git to use a proxy](https://gist.github.com/evantoli/f8c23a37eb3558ab8765)
- [Configure Git to use a proxy (https or SSH+GIT)](https://gist.github.com/ozbillwang/005bd1dfc597a2f3a00148834ad3e551)

### Other methods

*References*:

- https://github.com/dotnetcore/FastGithub

[//begin]: # "Autogenerated link references for markdown compatibility"
[cross-platform/git]: ../notes_OS/cross-platform/git.md "Git Configuration"
[//end]: # "Autogenerated link references"

0 comments on commit 0caf6e3

Please sign in to comment.