Earlier I was attempting to remove a commit from my commit history, and went through some stackoverflow threads doing stuff like rebasing etc.
Now here I am attempting to push a new commit, but I get this error which I feel is because of what I did earlier.
Error rebasing
fatal: update_ref failed for ref 'refs/heads/master': cannot lock ref 'refs/heads/master': ref refs/heads/master is at 9529c90e148e9b2620db0f366587312e75d507b6 but expected 808b9dfbc4141d16a29fadb4bd8171c6fe8f4914
Yes, you need to rebase first and then submit the checklist, currently the local and remote are at different level.
Just save your changed files, in some tmp directory, do the rebase(Menu->VCS->GIT->Rebase).
Once origin and remote are at same level, you may manually copy these files from temp, which will be shown in version control section of android studio. You can rightclick changelist and commit and push.
Regards
Ashish
Related
I was trying to clone Android Goldfish kernel source code by using the following command,
git clone https://android.googlesource.com/kernel/goldfish
but as it needed to download around 900MB of data I thought what the heck and went through with this one,
git clone https://android.googlesource.com/kernel/goldfish --branch android-goldfish-3.4 --depth 1
this reduced the download size to around 120MB and the downloading was done but with an error during unpacking objects.
Later when I used git status I saw a large number of files were deleted and they were shown as if they not even added and committed. I, foolishly, added them and committed them as new commit named 'local commit'.
git log --oneline
ca6ded2 Local Commit
2a51970 Merge branch 'android-3.4' into android-goldfish-3.4
c9cb2c8 UPSTREAM: netfilter: x_tables: fix unconditional helper
ac342b9 Merge branch 'android-3.4' into android-goldfish-3.4
Now after checking the files on remote, it became clear that the files which were shown deleted and which I committed are in the remote but not showing locally. So I tried to reset to previous commit. But these errors are shown:
git reset 2a51970
error: failed to read object b56d12bf5900c8f266132bc9b50dadfb092af10a at offset 26783674 from .git/objects/pack/pack-3ce58ac57f33a98f718e926caccca5ea5fa3a1fd.pack
fatal: packed object b56d12bf5900c8f266132bc9b50dadfb092af10a (stored in .git/objects/pack/pack-3ce58ac57f33a98f718e926caccca5ea5fa3a1fd.pack) is corrupt
fsck shows following:
git fsck
Checking object directories: 100% (256/256), done.
error: .git/objects/pack/pack-3ce58ac57f33a98f718e926caccca5ea5fa3a1fd.pack SHA1 checksum mismatch
error: index CRC mismatch for object b56d12bf5900c8f266132bc9b50dadfb092af10a from .git/objects/pack/pack-3ce58ac57f33a98f718e926caccca5ea5fa3a1fd.pack at offset 26783674
error: cannot unpack b56d12bf5900c8f266132bc9b50dadfb092af10a from .git/objects/pack/pack-3ce58ac57f33a98f718e926caccca5ea5fa3a1fd.pack at offset 26783674
error: index CRC mismatch for object 6149b476d9dffe06bcd1e3e3136bc335fd3dbf98 from .git/objects/pack/pack-3ce58ac57f33a98f718e926caccca5ea5fa3a1fd.pack at offset 27883077
error: inflate: data stream error (invalid distance too far back)
error: cannot unpack 6149b476d9dffe06bcd1e3e3136bc335fd3dbf98 from .git/objects/pack/pack-3ce58ac57f33a98f718e926caccca5ea5fa3a1fd.pack at offset 27883077
Checking objects: 100% (41134/41134), done.
My question:
Is there a way to fix this without initiating the cloning process again.
AND
Was the cloning done properly or I did something wrong there?
Thank you.
It seems I found a way to fix this!
For all object corruption error relating to git, I think the best, hassle free, thing to do will be to make use of git-repair.
My procedure to Fix this (Ubuntu 16.04):
Install git-repair
sudo apt install git-repair
Goto the local git repo directory
Run git-repair
git-repair
Thats it! All the corrupt objects were fixed(not going into technical details!) and the repo was in working condition.
is there any way to push a commit from android Studio that assigned to a issue that make issue done ?
my Git-lab is on our corporation Local serverand it's version is GitLab Community Edition 8.5.0 I tried:
Closes #issuenumber
Fixes #issuenumber
but these not works and just Gitlab findouts that my issue mentioned in commit.
I found this link with same problem. I also do:
Edit /etc/gitlab/gitlab.rb and add the line gitlab_rails['gitlab_issue_closing_pattern'] = '((?:[Cc]los(?:e[sd]|ing)|[Ff]ix(?:e[sd]|ing)?) +(?:(?:issues? +)?#\d+(?:(?:, *| +and +)?))+)'
Run gitlab-ctl reconfigure
but it does not solve the problem.
According to this page on GitLab
When you create a commit with a message starting with ‘Fixes #1’ or 'Closes #1’ and push it to master GitLab will close the issue you referred to. If you create a Merge Request targeting master with commits in it that will close Issues, GitLab will tell you which Issues will be closed.
That should solve your problem
I am using Github to sync my Android Studio Project.
I have been able to commit and push successfully for over a month.
After adding some files, I received this error.
12:44:45 PM Push failed: fatal: repository 'https://rrtigga#github.com/rrtigga.GetDisciplined1_0.git/' not found
However, the repo exists...
Here is a snippet from my terminal:
Rohits-MacBook-Air:GetDisciplined1_0 Spicycurryman$ git remote add origin rrtigga#github.com:rrtigga/GetDisciplined1_0.git
fatal: remote origin already exists.
Rohits-MacBook-Air:GetDisciplined1_0 Spicycurryman$
This is kind of an awkward error... I did some research and was unable to produce a solution.
GitHub: ERROR: Repository not found. fatal: The remote end hung up unexpectedly (different from similar posts apparently)
EDIT: It really exists:
https://github.com/rrtigga/GetDisciplined1_0
What is the problem here and how can I fix it?
You have a remote called origin which is configured to point to https://github.com/rrtigga.GetDisciplined1_0.git/, which is not the correct URL for your repository. You should be using either https://github.com/rrtigga/GetDisciplined1_0.git for access over HTTPS, or git#github.com:rrtigga/GetDisciplined1_0.git for SSH.
The error "remote origin already exists" means what it says: you're trying to add a remote with the same name as one that already exists. You need to either delete it first with git remote rm origin, or use git remote set-url to change the URL of the existing remote.
whenever I add an Android project to a git repository using the eclipse plugin EGit I get this Error message
Failed to initialize Git team provider.
when visualising the error log I get this :
Failed to initialize Git team provider.
Problems encountered while moving resources.
Could not move '/SearchInContatsWithLoader'.
Could not move: D:\AndrComp\SearchInContatsWithLoader.
Problems encountered while deleting files.
Could not delete: D:\AndrComp\SearchInContatsWithLoader\libs\android-support-v4.jar.
Could not delete: D:\AndrComp\SearchInContatsWithLoader\libs.
Could not delete: D:\AndrComp\SearchInContatsWithLoader.
Check if you don't have a windows process blocking those file (keeping an handle on them), which would prevent another process (like EGit) to move them.
To solve the issue, try to close as many processes as you can (or, even better, reboot and launch just Eclipse), and try again your operation.
I am trying to profile native android code, but I am getting the
following error.I am running the code on a linux machine.
$tracedmdump profile post-processing
traces...
Static basic blocks: 64525, Dynamic
basic blocks: 87073132
Static instructions: 412004, Dynamic
instructions: 509641730
Elapsed seconds: 26.46, simulated
instructions/sec: 19.3M
generating dexlist output...
generating dmtrace data...
Error: stack overflow (500 frames)
If anyone knows how to debug this issue...please help
Thanks and Regards,
Bharat Pawar
From your post and the Android GIT commitdiff it looks like this line in the "tracedmdump" shell function went wrong:
q2dm -r $ANDROID_PRODUCT_OUT/symbols $TRACE $KERNEL $TRACE/dmtrace
The q2dm command is part of the qemu emulator tools for Android.
Looks like the problem has actually been fixed and changed source committed.
a. If you can, synchronize your local GIT repository with the Android GIT repository and build yourself a more current version of the q2dm tool. b. Alternatively, check/wait for the next NDK (sub-)release for a more current q2dm version.
Hope this helps!