Tag Archives: Go

c:\Git\bin\ssh.exe: *** Couldn’t reserve space for cygwin’s heap, Win32 error 487

Today, suddenly uploading code to the code cloud with AS failed and there was a problem
Tried to save uncommitted changes in stash before Update, but failed with an error. stash file://D:/AndroidStudioProjects/VRvr: 0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487 AllocationBase 0x0, BaseAddress 0x68550000, RegionSize 0x1E0000, State 0x10000 C:\Program Files (x86)\Git\bin\sh.exe: *** Couldn’t reserve space for cygwin’s heap, Win32 error 0
Found click Git bash flash back
Looked up a lot of data on the net also made along while, my solution is as follows
1. Reinstalled git client first
Find it useless
2. Run the CMD window
perform

c:\msysgit\bin>rebase.exe -b 0x50000000 msys-1.0.dll

Found in

ReBaseImage (Msys-1.0.DLL) failed with last error = 6
A few more runs still won’t do
3. According to the Internet
It is still useless to copy out the Msys-1.0.DLL under C:\Program Files (x86)\Git\bin and then copy it in.
Solutions;
Finally, I executed step 2 as an administrator and it was successful
Run as an administrator:
Find the CMD. Exe file under C:\Windows\System32, right-click and select Run as administrator — ‘OK

Git did not exit cleanly (exit code 128)

Problem description:

After creating an empty local Git repository, it is intended to Pull the code in the remote repository to the local exception. The specific exception contents are as follows:
git.exe pull –progress -v –no-rebase “origin” master

POST git-upload-pack (275 bytes)
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (6/6), done.
warning: No common commits
remote: Total 7 (0) delta, reused 3 (delta 0), pack – reused 0

* From https://github.com/Jackson-AndyLau/CMSManager branch master – & gt; FETCH_HEAD
* [new branch] master -> origin/master
fatal: refusing to merge unrelated histories

git did not exit cleanly (exit code 128) (4469 ms @ 2018-07-01 11:13:35)

As shown in the figure below:

Solutions:

About this problem, the general solution and the core solution of the content encountered in the previous problem are the consistent “Git did not exit Cleanly (Exit Code 1) solution”.

1. According to the error prompt, we need to delete the git configuration file of the local repository to form an empty folder. Nothing in git folder should appear, and then “Git Clone” project from the remote repository directly, as shown in the figure below:
Empty folder:

2. Directly from the remote GitHub Clone project, it was found that the Clone succeeded, as shown in the figure below:

3. After remote Clone, the following figure appears:

Ok, this is the solution for Git did not exit Cleanly (Exit Code 1). If you have any questions or encounter any questions, please feel free to leave a message to me. I will answer them in detail.
xiehouyu: “learn together, progress together”, also hope that we pay more attention to the CSND IT community.

MacOS Catalina (system): xcrun: error: invalid active developer path(), missing xcrun at / Library

Question why
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
A scenario
git
SVN is not working properly
Idea suggests that the SVN path is not correct
The solution
Open the command terminal to run

xcode-select --install

After entering, the system will pop up and download the Xcode component. Click “Ok” and the download will be completed.
xcode-select: note: install requested for command line developer tools
Problem analysis
At first, I thought the SVN path was incorrect, but it was correct after repeated confirmation.
If you think SVN is gone, consider the MAC’s own Subversion can’t go wrong.
Finally, In SVN — Version, I was given an error notification prompt:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
And Then I Command C, Command V, and I open Baidu, and I do it all at once.
The problem summary
A lot of Mac software relies on xcode’s precursors.

Jenkins git configuration error status code 128 ‘text file busy’

When Jenkins was used, all of a sudden the jobs could not be executed, and the configuration page prompted an error, as follows:

After Baidu, many solutions were only for the type “returned Status code 128”, with the detailed error of SSH-key, git server could not request to wait, and no error about “Text File busy” was found.
Finally, I found the answer to Jenkins’ official Github question,
https://github.com/joelittlejohn/embedmongo-maven-plugin/issues/28

The simple answer is that Jenkins was on a server that ran out of disk space.

Idea update failure problem: couldn’t save uncommitted changes solution

An error occurred during the update of the project today, which could not be solved after a long period of debugging.
error reason:

  Couldn't save uncommitted changes.
  Tried to save uncommitted changes in stash before Update, but failed with an error.
  Couldn't stash file://H:/IdeaProjects/SVSP_0.4: git-write-tree: error building trees
  Cannot save the current index state

After gradual investigation, it was found that colleagues uploaded redundant files, which caused the collective failure to update. The solution is as follows:
Enter

    into your project directory. My directory is H:\IdeaProjects\ svsp_0.4 . Right-click on Git Bash here and type Git status. Notice the Unmerged paths
Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git rm <file>..." to mark resolution)
        both deleted:    .idea/artifacts/SVSP0_4.xml
    was found because there were extra files uploaded, and both deleted: followed by .idea/artifacts/ svsp0_4.xml this file is typed in git rm.idea /artifacts/ svsp0_4.xml and then enter the idea update to resolve the problem

Git push failed, prompt unpack error / unpack failed solution

after you execute the command git commit -amend to amend the commit, then execute git push review HEAD:refs/for/ XXXX to submit the code to Gerrit, but the commit failed and print out the following prompt:

qidi.huang@droid10$ git push review HEAD:refs/for/xxxx

Writing objects: 100% (1/1), 258 bytes | 0 bytes/s, done.  
Total 1 (delta 0), reused 0 (delta 0)  
error: unpack failed: error Missing tree a0abf7e9827e74b7d729485fcd3714bc6a1ce898  
fatal: Unpack error, check server log  
To ssh://[email protected]:29418/kernel/common  
 ! [remote rejected] HEAD -> refs/for/xxxx (n/a (unpacker error))   

we can solve this problem by adding the --no-thin parameter to the submission. In other words, we can use the following command to submit:

$ git push --no-thin review HEAD:refs/for/xxxx

Git push –help) git push –help

--[no-]thin
    These options are passed to git-send-pack(1). A thin 
transfer significantly reduces the amount of sent data when 
the sender and receiver share many of the same objects in 
common. The default is --thin.

failure should be analyzed from the log of Gerrit server. I didn’t check the log (as if I didn’t have permission), but according to other colleagues, the problem may be “Gerrit is not compatible with git. This is because when Git is committed, an open review request is generated in Gerrit, but this request does not belong to any of the commits.

[reference]
[1] git flow and gerrit
[2] git push error: unpack failed: index-pack abnormal exit

Support annot run git xcrun: error: invalid active developer path

The Mac upgraded the system and found Git broke in idea…   
Complete error message
С annot Run Git
xcrun: error: invalid active developer path (/ Library/developer/CommandLineTools), missing xcrun at:/Library/developer/CommandLineTools/usr/bin/xcrun

to see if Git can be used properly on the command line -help still registers the same error as above
In the search under git installation directory
Whereis the git
/usr/bin/git
The git installation location can be printed correctly
If there is a problem with the Git installation, brew Install Git is used again
Error: The following formula:
git
cannot be installed as a binary package and must be built from source.
Install The Command Line Tools:
xcode-select — Install
Error: Git must be installed and in your PATH!
Error: The following formula:
git
cannot be installed as a binary package and must be built from source.
Install The Command Line Tools:
xcode-select — Install
This error prompts xcode-select –install
Then use Xcode-select-install to solve the installation successfully

The console sees the successful output using the git –help command
Solution: use Xcode-select-install to complete the installation and restart idea
 

push failed The requested URL returned error: 403

Once the code is written, synchronize the local repository with Github.

 git push -u origin master

error: The requested URL returned error: 403 Forbidden while accessing https://github.com/user/test.git/info/refs
This is due to permission issues, you can modify. Git /config file appends username and password:
1) Edit. Git /config file
2) Find the URL variable under [Remote “Origin”]
3) modify the url = https://github.com/user/test.git, modified to url = ssh://[email protected]/user/test.git, finished modification
4) Push origin Master through Git to synchronize, which has been successful

Error: your local changes to the following files would be rewritten by merge solution

The background,
Other members of the team have modified a file and submitted it for storage. You modified the local file before pull. When you modify the code and pull again, the following error will be reported:
error: Your local changes to the following files would be overwritten by merge
Ii. Solutions
Depending on whether you want to save local changes, there are two solutions
2.1 Reserved modification
Execute the following three commands

git stash
git pull origin master 
git stash pop 

Note:
Git Stash: Back up the current workspace, read from the last commit, and make sure the workspace is the same as the last commit. At the same time, save the contents of the current workspace in Git stack. Git Pull: Pull the current branch code on the server. Git Stash pop: read the last saved contents from Git stack and restore relevant contents of the workspace. At the same time, users may perform stASH operations for many times, and need to ensure that the first stash is fetched after, so the stack (in and out) is used for management. Pop the top of the stack and restore the Git Stash List: Shows all the backups in the Git stack, and you can use this list to decide where to restore. Git Stash Clear: Clears the Git stack
2.2 Scrap modification
The core idea is to roll back the version, as follows

git reset --hard 
git pull origin master

Note: The second type is not recommended. Unless you’re sure you don’t need a local change.

pathspec ‘master’ did not match any files known to git

The scene that emerges
Init init a warehouse locally, then create a develop branch, and do file operations on this branch, followed by the changes made by commit.

$ git init
Initialized empty Git repository in D:/practice/testBranch/.git/
$ git checkout -b develop
Switched to a new branch 'develop'
$ vim a.txt
$ git add a.txt
$ git commit -m "add a new file"
[develop (root-commit) f9ac3b8] add a new file
 1 file changed, 1 insertion(+)
 create mode 100644 a.txt

And then you go to the master branch, and you do the file manipulation. This is where the following error occurs:

$ git checkout master
error: pathspec 'master' did not match any file(s) known to git.

The cause of the problem
The command parsing
By default, the git init command creates a master branch and points the HEAD(which is a special pointer to the current local branch) to that branch. However, when you view local and remote branches using the git branch-a command, you won’t see any branches.
git checkout master command actually does two things: one is to make HEAD point back to master branch; The other is to restore the working directory to the snapshot content pointed to by the master branch.
Problem analysis
After the HEAD refers back to the master branch, the working directory needs to be restored to the content pointed to by the master branch. But since you’ve been working on the develop branch since the beginning, the working directory corresponding to the master branch is as good as nothing, so you can’t match any files.
How to solve
You just need to initialize a warehouse and first do some commit on the master branch, such as adding a readme.md file, thus creating a master branch. Such as:

$ git init
Reinitialized existing Git repository in D:/practice/testBranch/.git/
$ vim README.md
$ git add README.md
warning: LF will be replaced by CRLF in README.md.
The file will have its original line endings in your working directory.
$ git commit -m "add a new file"
[master (root-commit) 0e8c7c3] add a new file
 1 file changed, 1 insertion(+)
 create mode 100644 README.md
$ git push
Counting objects: 3, done.
Writing objects: 100% (3/3), 219 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote:
remote: Create a pull request for 'master' on GitHub by visiting:
remote:      https://github.com/benben/testBranch/pull/new/master
remote:
To github.com:benben/testBranch.git
 * [new branch]      master -> master

When you do a push operation, you will see that a master branch has been created in the remote warehouse, and the local master branch points to the remote master branch.
then you can see all local and remote branches by using git branch -a. You can then create additional branches and switch between master branches at will.

$ git branch -a
* master
  remotes/origin/master

When switching branches, make sure that the files in your working directory are changed. If you switch to an older branch, your working directory will revert to the way it looked the last time the branch was committed. If Git cannot do this cleanly, it will forbid switching branches.

Git solves pull origin error: the following untracked working tree files would be rewritten by merge

error: The following untracked working tree files would be overwritten by merge:

bin/AndroidManifest. XML

Please move or remove them before you can merge.

Aborting

scheme 1:

git clean-d-fx “”

one of them

x — deleting ignored files is no longer recognized by git

d — deletes files not added to git’s path

F — Forced operation
Scheme 2:

The following error occurred in git pull on the server today:
error: Your local changes to the following files would be overwritten by merge:
application/config/config. PHP
application/controllers/home. PHP
Please, commit your changes or stash them before you can merge.
Aborting
I do not know what causes the code conflict, the solution is as follows:
If you want to keep the changes made on the production server, simply incorporate the new configuration item:
git stash
git pull
git stash pop
You can then use Git diff-w + file names to verify that the code is automatically merged.
If you want to completely overwrite the local working version with files from the code base, do so as follows:
git reset –hard
git pull

Solution 3:

Problem 1: Fix GIT repositories that are out of sync
Appear today when performing git pull:

 
    [root@gitserver /data/work/www/rest/lib/Business/Inventory]# git pull  Enter passphrase for key '/root/.ssh/id_rsa':  Updating 70e8b93..a0f1a6c  error: Your local changes to the following files would be overwritten by merge:          rest/lib/Business/Inventory/ProductStatus.php  Please, commit your changes or stash them before you can merge.  Aborting 

The solution :
executes git checkout-f, and then pulls git checkout again

 
    [root@gitserver /data/work/www/rest/lib/Business/Inventory]# git checkout -f  Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded. 

When git pull is performed, it is ready:

 
    [root@gitserver /data/work/www/rest/lib/Business/Inventory]# git pull  Enter passphrase for key '/root/.ssh/id_rsa':  Updating 70e8b93..a0f1a6c  Fast-forward  rest/lib/Business/Inventory/ProductStatus.php |    1 +   1 files changed, 1 insertions(+), 0 deletions(-)   mode change 100644 => 100755 rest/lib/Business/Inventory/ProductStatus.php 

 
Second problem: the default location of Git Pull.
1. When Git is under the branch of master, the default remote is origin;
2. When using git pull under the master brach, specify remote and merge, use the default remote and merge.

but for your own project, and push to the remote server, there is no such thing, you need to configure yourself.
if you directly run git pull, you will get the following results:
Tips after executing Git Pull:

 
    $ git pull  Password:  You asked me to pull without telling me which branch you  want to merge with, and 'branch.master.merge' in your configuration file does not tell me, either. Please  specify which branch you want to use on the command line and try again (e.g. 'git pull <repository> <refspec>').  See git-pull(1) for details.     If you often merge with the same branch, you may want to use something like the following in your configuration file:     [branch "master"]   remote = <nickname>   merge = <remote-ref>     [remote "<nickname>"]   url = <url>   fetch = <refspec>     See git-config(1) for details. 

The solution is to configure git Config as follows.

 
    git remote add -f origin [email protected]:rest.git  git config branch.master.remote origin  git config branch.master.merge refs/heads/master 

Plan 3 from “ritto ‘s blog” blog, please be sure to keep this from http://ritto.blog.51cto.com/427838/741342

Couldn’t reserve space for cygwin’s heap, Win32 error 487

Couldn’t Reserve space for Cygwin’s heap, Win32 Error 487 occurred when Git was being committed or pulled, the solution was:
Locate the bin folder of Git’s installation directory, open a command window here, and execute the following command:
Rebase. Exe – b 0 x50000000 msys – 1.0. DLL
Both rebase.exe and Msys-1.0.DLL are files in the bin folder