Tag Archives: Go

Git clear saved accounts

Git will automatically save the user name and password you have entered.
Git’s configuration file is ~ /.gitconfig. GitConfig can be opened with Vim ~/. GitConfig from the command line of Git Bash and Mac under Windows.

Windows
 

git config --system --unset credential.helper

 
Mac
 

sudo git config --system --unset credential.helper

 

Reproduced in: https://www.cnblogs.com/sea-breeze/p/9174557.html

Git bash display error can not be used, how to solve

Solution:
It seems that the 64-bit version will have problems, but 32-bit Git can also be installed on 64-bit systems.
Once you have unloaded your 64-bit Git installation, download a 32-bit Git installation and you will be able to use it normally.
Of course, your 32-bit error, unloaded after the same process, install 64-bit, this will not be a problem, but 32-bit more stable.

Reproduced in: https://www.cnblogs.com/flxy-1028/p/6922987.html

Git bash error, version 2.16.2-64-bit

Environment: Win7 64-bit
Error: Could not fork child process: Resource temporarily unavailable (-1).
DLL rebasing may be required; See ‘rebaseAll/rebase — help’.
 
Failed to fork child process no such file or directory, DLL rebasing may be required
 
Solutions:
1. Go to the Git installation directory and run git-cmd.exe;
2, Execution command: CD usr/bin, enter /bin directory;
3, Execute command: CP MSYS-2.0. DLL.. /, copy msys-2.0.dll to the directory above;
Rebase-b 0x76000000… rebase-b 0x76000000…/msys – 2.0. DLL
Rebase-b 0x30000000… rebase-b 0x30000000…/msys – 2.0. DLL
6, Execute command: cp.. /msys-2.0.dll. Copy msys-2.0.dll back to /bin current directory (.. Represents the current directory)
 
Rerun git-bash.exe, problem solved!
 
If the problem persists, try modifying the registry:
1. Open Run and type regedit to open the registry
[HKEY_CLASSES_ROOT \ DIRECTORY \ BACKGROUND \ SHELL \ GIT_SHELL \ COMMAND] :\Program Files\Git\git-bash.exe
3, Replace it with C: Program Files\Git\bin\sh.exe
 
 
 

Git bash here running error: failed to fork child process

The following error occurs when you run Git Bash Here…

Git bash here Failed to fork child process: No such file or directory

The Git version is 2.9.3, and reinstalling different versions of Git does not solve this problem

Solution:
Step 1: Find the Git installation directory on your computer
Step 2: Enter the directory –>; user –> Bin, locate the msys-2.0.dll file
Step 3: Copy msys-2.0.dll to a directory
Step 3: Open the CMD command in the bin file (Shift + mouse right-click –>; Open the command window here), and run the command
Rebase – 0 x76000000 b… \ msys – 2.0. DLL
Rebase – 0 x30000000 b… \ msys – 2.0. DLL
Step 4: Replace the DLL under the bin file with the MSYS-2.0.dll copied in the third step

You are not allowed to upload merges in Git push

Git add -u filename git add -u filename git rebase — continue git rebase — continue git rebase — continue git rebase — continue git rebase — continue git add -u filename Commit is not required. And then finally, code. (reference links reference 2)

the cause of the problem: in the local branch ahead remote branch commit more than one, is the bifurcate, in this case, use the git pull after updating the code to git push will have such a situation,

solution principles: use rebase, “give up” the local patches, but is saved and then add in the front of the remote branch.

base parse link
Attached is a blog post with a lot of git error parsing: click the Open link

[FAQ] after git merge, the push to Gerrit fails, indicating no new changes?

Requirement: Git branch merge
Git Merge: A branch merge is performed locally with Git Merge, and you want to push it to Gerrit to review the repository. However, when you commit it, you can say:

! [remote rejected] HEAD -> refs/for/dev (no new changes)

No new changes have been made to the system, but the changes are linear. Gerrit will not allow you to submit a review if you don’t have a new commit. If you don’t have a new commit, Gerrit will not allow you to submit a review.
Method 1: When git merge, add the –no-ff parameter to make it a new commit so that it can commit ~ (but the generated Gerrit change does not see the change).
Method 2: Push directly into the remote library without going through Gerrit. (Not recommended)

Inexplicable exception 007: git error: authentication failed for

It may be that your password to connect to git has been changed, but not the local configuration. However, Git doesn’t have pop-up boxes that prompt you to change your username and password.
Then you can do the following:
1. Open git bash here
Git config –system –unset credential. Helper
3. Then do anything like push, pull, or clone
4, You are prompted to enter the user name and password, change it
Git config –global credential. Helper store
6. Execute 3 again and enter the username and password
7, OK.

Failed to push some refs to

error: failed to push some refs to
error: failed to push some refs to... error: failed to push some refs to...
Summarize the causes and solutions
No code submitted
You can use git status to see if you forgot to commit your code. If you forget, just submit it.

  git add .
  git commit -m "This is a new commit"
  git push origin master

Conflicts arise between local and remote

    strong coverage

      git push -f origin master
    
      first back to pull
      git pull –-rebase origin maste
      git push origin master
    

    record

gerrit error: missing Change-Id in commit message footer

Recently, the company warehouse changed from Gitlib to Gerrit, and you need to get the boss to review the submitted code before you can push it. This error occurred the first time it was used.
record, also convenient to check in the future:
Step1: copy this sentence to the terminal (on your own terminal)
gitdir=$(git rev-parse –git-dir); SCP – p – p 29418 102001111 @192.168.132.200: hooks/commit – MSG ${gitdir}/hooks/
step2: paste directly to the terminal (without modifications exit row)
the git commit – amend
step3: paste to the terminal (dev branch can be amended as required)
git push origin HEAD: refs/for/dev
Reference:
https://blog.csdn.net/weixin_33910385/article/details/92457771