STS getting this while pull/fetch latest changes Couldn't lock local tracking ref for update - egit

Getting this issue in spring tool suit while fetching/pull latest changes from remote branch. i don't have git bash on my local previously it was working fine right now i am getting below mention issue.
Couldn't lock local tracking ref for update

I also encountered same problem
But I removed this problem using GITHUB Desktop tool.
Once I executed pull from STS, its showed the dialog box with error as shown above. and a up arrow got appended showing there are some commit to be pushed,
though I had not made any commits before this pull. The changes from pull were not added to my local project.
I checked on Github Desktop, and it also showed same arrow.
I pushed it from tool, and it was resolved. The changes from pull got added to local project.

While you don't have git bash, Eclipse is using its own JGit (java-based implementation of Git)
As recommended in "egit lock fail eclipse", do check if you have any "<refname>.lock" file under .git/refs/". (howlger refers to eclipse issue 417860:
I checked in jgit and egit sources and found that the only occurrence of the text "[lock fail]" is used when fetch fails to update a remote tracking branch.
This can happen if a previous crash didn't cleanup a "<refname>.lock" file which git creates as a lock to guard the ref against concurrent updates.

git remote prune origin
solved same problem for me

Related

Blogdown - window to stage and commit changes no longer appears

I recently created a website using blogdown and now hosting it on a GitHub repository and netlify to deploy. When I set it up, I followed the directions to clone my GitHub repository to be able to commit files using the git version control. So making changes within Rmarkdown and then committing them to my GitHub repository was easy.
However, when I connect to the project now, the window where I can commit changes does not appear. That is, I no longer have the option to commit changes within R studio. My guess is that the connection between the terminal and GitHub was changed/removed? Does anyone know how to re-establish this? I've looked up the syntax to use in the terminal, but I couldn't find a similar problem - that is, re-establish the connection between my GitHub with an already existing project already on my desktop.
Posting an answer to this question in the case others have a problem. It was an issue with MojaveOS. You have to re-install command line tools in the terminal.
xcode-select --install
Doing this, the version control now works to commit files to my github repository.

IOT Kura Installation unable to fetch from git hub repo and Repo Not Found

Currently I'm facing an issue while installing Kura using Eclipse Installer.
Attached the screenshot and log for further reference.
I hope the issue is unable to pull from git repo.
Could somebody help me out and let me know in case of any further details required.
UPDATED as on 03-09-2017
Now the issue is different attached the screenshot for your reference and when I click back the git repo is not found .
I trying to setup more than a month but still couldn't it what is the other way to explore Kura.
From this eclipse bug, this is more likely related to a network issue.
It seems the session has been dropped in making a channel connection.
|And most important: How can we avoid this?
There must be many reasons for unexpected session drops caused by
external factors, so I suggest to re-try making sessions or channels
at such a case.
If that persists, try and use https url:
git config --global url."https://".insteadOf git#
The error message seen looks like JGit issue 455005:
java.io.IOException: Could not delete file C:\path\to\repo\.git\objects\pack\pack-5cb....pack
That's a common problem on Windows systems. As soon as you open a repository and do operations which access the packfiles (nearly all git operations do that: staging view, history ...) JGit caches data from the packfiles and keeps handles to packfiles open. But as long as handles are open you cannot delete the file under windows.
On Unix systems you don't have this problem because you can unlink files on which you have open file handles. The root cause for your problem is that we delete the repo only halfways. Aftwards we have a corrupted nearly empty gitdir and that reflog doesn't work on that is only the smallest of all problems.
check if the issue persists after a reboot (to make sure there is no other process preempts the file).
If not, try deleting fully (with Eclipse closed), and try again to clone it.
See also bug 336800:
You are creating a new Git object that has a repository associated with it.
This repository is automatically opened and thus has to be closed so that file resources are released.

How to view file changes before pulling through GitHub on RStudio?

I'm transitioning from using Subversion in Eclipse for code management to GitHub in RStudio. It's starting to make sense, but I can't seem to figure out how to pull effectively.
Specifically, if I use the Pull arrow in RStudio, every file change in the repository automatically updates my local files without warning. I can see how many files were updated, but not what changed!
Here are the questions I'm hoping to get help with:
1) Can I preview the repository file changes in RStudio before I pull them locally? With SVN in Eclipse, there was an indicator showing files with a difference, and the option to view side by side.
2) If multiple files have been changed on the repository, is it possible to pull just 1 locally?
3) How can I revert a local file to a previous version?
Right now I've been trying to do this all within RStudio for simplicity. I haven't used things like the GitHub desktop client.
I appreciate the help!
I would suggest you better get used to the git's own tools to stay informed about your repository.
For example you could do following.
Before you pull, check your current commit logs
git log
This should show you how your current commits stack up. Note the latest commit id (first 4-5 letters would usually do)
Now after pulling you can see the difference using following command
git diff --color your_previous_commit_id..HEAD
If you don't like the changes and want to go back,
you can just reset to your favorite commit with following command. BTW run "git stash save" to keep a copy of your uncommitted changes.
git reset --hard you_favorite_commit_id
Note: that this will delete all your uncommitted changes unless you stashed them and put your local branch behind the remote repo branch you are tracking again.
Wondering where to put these commands? Check https://git-scm.com/downloads.
What's good about using these git tools is that if you switch between IDEs you don't need to search for same functionalities you had in your earlier IDEs.

Replacing the working directory with an earlier git commit

Here is the context:
I am using egit within Eclipse
I made a number of commits that I have not pushed to the remote repository
I suddenly notice a bug with my app that wasn't there before
How can I quickly update my working directory with earlier git commits until I find the first commit that introduced the bug? How do I then get back to my latest local commit?
I used hard git resets to do this recently and would have lost my last set of git commits if I hadn't found this answer so there must be another, safer way to achieve the same result.
I am running into a bug in my latest version of the code and want to go back in time until the bug no longer shows up.
That is called git bisect, and is not implemented in Egit.
You should consider using git in command-line, in order to launch a bisect session.
I just figured out the answer to my own question.
It's actually quite simple:
Do git checkout of earlier versions until identifying the last version that does not exhibit the bug and the first one that does
Then do a git switch to the master version to go back to the latest committed version
The checkouts are not intended to make further changes to the code but are quick and useful for updating the working directory without messing with the git directory, which is all what's needed to quickly pin-point the appearance of a new bug in the git tree.

EGit greying out / not showing commit

I've been running into a wired problem (which has been described (but not solved) here as well:
I used to develop using PyDev and Egit (recent versions, EGit is 3.0.3) with just a local repository. Everything worked fine, I was able to commit, branch, reverse etc. just using the "Team" menue in my PyDev perspective.
Now I added a remote reposisory to host the project and since then, I can not commit to my local repository. File changes are not detected (even worse: I change file A and afterwards all folders are marked as "changed" (having the ">" icon) and no file is recognized as "needing synchronization". The only menu points which are available are "Add to index" (which has no effect) and "Pull" (which says "everything is up to date" - which is true since there is nothing new on the server to pull).
When I use git (either command line or git extensions), I see the changed file as changed and it's offered for staging. I can use plain git to commit, push, etc, everything works as expected and no error messages are shown. I'm just using one branch (master).
Even if I open the "Git Repository Exploring" perspective in Eclipse and got to the tab "Git Staging", the file is listed.
I jus started a new test project with just a local repository (residing in the same git-folder ~/git) and here I can commit as I'm used to... And I added the project to the same repository server - and still everthing works! I can commit, I can push, everything is fine there...
yes, I can work around hat by using git extensions, but I really liked the smooth integraion of git in eclipse. Therefore, all ideas, remarks etc. are very welcome! And yes, I tried restarting eclipse ;o).
Finally!!!
Since everything was working before I added the remote host, amd everything worked in my small toy project, I removed and re-added my remote host using gut bash:
git remote remove origin
git remote add origin git#my_servername:my_repository.git
I suppose some configuration files were corrupted in a very non-obvious way (I checked all config fiels and did not notice anything...)
Sounds like a bug, and you might be able to get it back to a good state by playing around with the plugin setting data.
Located here: ${workspace}/.metadata/.plugins
I highly recommend backing up that whole folder before you start playing around. I have had other eclipse issues that have been resolved by going in here and deleting things.