Table of contents
The problem of garbled Chinese display in git log under Ubuntu while foreign languages are displayed normally
Description:
The Chinese is displayed as angle brackets <E4><B8><B4><E6><97><B6><E4><BF><9D><E5><AD><98>
Solution:
|
|
Similar problems may also occur when using git status, but the causes are different. The following command can be used to solve it
|
|
Multiple uncommitted changes still exist on another system after committing when developing based on mounted files across systems
Description:
When local development is performed between multiple systems and the mounted directory is used for coding and commit separation, it often occurs that a commit is made on one end, while the other end, such as VS Code, prompts multiple unadded changes. This is often due to the filemode difference between different systems.
Solution:
|
|
Modify submodule
Modify the url attribute of the corresponding module in the.gitmodules file;
Use the git submodule sync command to update the new URL to the file.git/config;
Then use the command to initialize the submodule: git submodule init
Finally, use the command to update the submodule: git submodule update
Reference: Git Modify. The URL of the Submodule File Takes Effect
Error when pulling submodules from non-current user or group repositories using gitea action
Reference Key Configuration for gitea action checkout
It is necessary to configure the key pair of the action properly. Configure the public key in the submodule one by one and the private key in the repository where the action is located and pass it to the action. After correctly configuring the key in the action, the pull can be performed normally.
Set different upstreams for different branches in git
one repo with multi upstream
Configure Different Remote Repositories for Different Branches
Logical View
Implementation Process
- Create a New Repository
If based on an existing repository, skip directly to step 2
|
|
- Add Remote Repository Sources
|
|
Display Remote Repositories:
|
|
- Create a Blank Branch
|
|
If it is based on an existing branch, it needs to be emptied
|
|
- Pull Branches and Associate Local Branches with Remote Branches
Under the created blank branch, pull the code of the specified branch of the remote repository.
|
|
At this point, we have created a local branch and associated it with a remote branch.
Similarly, to create other branches, just repeat steps 3 and 4.
For example, to create the private branch and associate it with the private branch of the remote repository mydomain, the steps are as follows:
|
|
- Push Local Branches
Because the local branch has been associated with the remote branch, only git push is needed when pushing.
If the remote branch has not been associated, then:
|
|