How to end 'another git process' running in same repository? - github

After my first attempt at committing a couple of large folders (angular and django), git responded with:
Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
Previous posts recommend:
removing the index.lock in the .git folder.
I've done this, but the second that i resubmit "git add . " as part of my git push origin master routine, the index.lock file reappears in .git
Is there another solution? And what has happened to warrant this?
I've tried all the suggestions in the commented link
I'm working with this:
git version 2.13.5 (Apple Git-94)

In my case, index.lock wouldn't delete. Instead, I found that one of my django folders lacked a .gitignore, so I created one and included the following files:
include
lib
include
bin
.vscode
You might want to include more or less, depending.. Apparently, I was attempting to push a file that disagreed with git.

Related

Accidently deleted every file in Vs Code while trying to push to git, any way to recover them?

I am a complete noob so while trying to deploy one of my programs to heroku, I needed to push it to github, in Vscode while trying to do that, I got a whole bunch of files that I didn't want to upload on github, so I hit remove all from this screen
I now realize that I deleted everything and I don't know what I can do, I tried going into my drive and hitting properties to try and restore but looks like I hadn't turned that feature on. Is there anyway I can recover my files? I am on windows
Simply go to your terminal and navigate to the folder you are pushing to git. You can run these commands:
git log --pretty=oneline (Shows all previous commits)
git checkout . (This resets everything to the previous commit)
Once you have reset your project to the previous commit, try again and delete the files you wanted to remove. Then perform the git commit -am "text here" and git push heroku master commands.
EDIT: This only works if you have already made git commits. If you have deleted everything and git log --pretty=oneline does not show any commits, then there is no way to recover the deleted files.
You can also check the recycle bin of your computer to see if the deleted files are there.

eclipse github desktop ignore error

error: Your local changes to the following files would be overwritten by merge:
adminpage/.metadata/.log
adminpage/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources
adminpage/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs
adminpage/.metadata/.plugins/org.eclipse.datatools.sqltools.result/results
adminpage/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
adminpage/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/com.genuitec.eclipse.aeri.server1/server-config.json
adminpage/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/server-config.json
Please commit your changes or stash them before you merge.
Aborting
Use the git hub desktop.
The team members share their performance with a git, and every time they commit it, they are outweighed by the difficulty of printing.
I've tried everything on the Internet, and I've tried to do this, and I've tried to do this, and I've tried to change this, and I'm not going to go through this.
I'm creating a jsp based web source with Eclipse, but I don't know what's wrong with it.
I'd like to get the help of millions of experts here.
If you can, it would be easier to ignore the .metadata/ folder entirely:
git rm --cached -r adminpage/.metadata
echo "adminpage/.metadata/" >> .gitginore
git add .gitignore
git commit -m "remote and ignore adminpage/.metadata"
git push
Repeat that in every branch where that folder is still tracked, and the error should not be seen again.

How to remove a specific directory from GitHub using Eclipse

I've looked all around for a few days now trying to figure this out because our .gitignore even though it lists /bin/ folder it still keeps freaking commiting the whole folder and its getting annoying.
Now we have a whole bunch of crap in a /bin/ folder in our GitHub repository and I have no idea how to remove it. I've tried looking at other peoples examples but they keep talking about a shell command that I don't have in eclipse (or at least don't know how to access)
The sad news is that if a file has been already committed to GitHub, git will continue to version that file.
This means if I commit the entire bin/ then add it to .gitignore, the files will still persist in GitHub. And, if these files in bin/ change, they will also be pushed in the commit because they are versioned.
Luckily, you can remove files and directories from GitHub completely. You need, though, to get to a command line running git. If you have the GitHub application installed, that probably means you have git.
Open command prompt in Windows or Terminal in Mac OS.
Navigate to the directory (ie. cd ~/Workspace/Project) and run the following:
git rm bin/* -f
git commit --amend
git push -f
This should work. Check out this article on the GitHub that also outlines the process.
Hope this helps you!
Disclaimer: always make sure you do your research before working with git. If you have various branches / other complicated stuff going on, this process might be different

I've configured Composer to download HTMLPurifier locally, but Git won't push all the files to my OpenShift master repo. Why not?

I've got Composer installed and I've used it to download HTMLPurifier locally. Now I'd like to push that download to my OpenShift Git repo. So, in a Git Bash window, I run the following...
git add -A :/
git commit -a -m "Uploading HTML Purifier"
git push origin master
At this point Git reports that the push was successful but when I ls the directory through SSH, it shows that the HTMLPurifier directory is empty. Why is that? How do I get Git to push those files?
Additional Info: I noticed that the HTMLPurifier directory is indeed a Git repo itself and contains a .gitignore file in its root directory. I tried deleting it and re-running the above commands but to no avail...
You should try to avoid pushing downloaded dependencies into a repository. It is recommended to add the vendor directory into the .gitignore file at top level. But what you must do instead is commit and push both composer.json and composer.lock.
Here's why: The vendor directory is managed by Composer. Running Composer will probably do minor things during an update, but may also be doing heavy stuff if the Composer team decides to optimize things.
Also, if you require a branch of a package, and Composer knows the repository of that package, it will default to cloning a Git repo or do a SVN checkout instead of trying to grab a ZIP package of that branch (often there is no way to get such a package for branches, and even tagged versions in a plain Git repository do not have such download ability. Composer knows that Github offers such downloads, and detects Github by looking at the repo URL.)
So you can assume that Composer will put a lot of repository meta data into the vendor file, and if you blindly commit these, things will get ugly. First of all, you are committing way too many files, increasing your repository by an unnecessary amount, which will slow down things. Then, if cloning Git repositories, these will be treated as submodules, and that has another bunch of nastiness I am told. If you are just learning Git, it probably isn't a good idea to start with these. And if you are sufficiently known to the tools (Git and Composer), you probably won't need them either.
There really is only one reason why you'd try to commit a modified version of the vendor directory: If your release process is completely depending on all files being present in your one repository, without any way to run a composer install during the release to make these files appear on the target server.
In such cases, you'd install or update the packages with Composer, and then go through all created directories and delete any .git and .svn (and probably also .hg for Mercurial) folders you encounter. Only then you'd be able to commit the files into your own repository.
But note that this step might be a tedious step to do manually - you probably want to create an update script that does all that work for you. You also might run into issues when updating dependencies because Composer expects files to simply go away when deleted, and not be in the way when being written. I cannot tell you exactly what you'd be experiencing because it depends on how you'd do stuff, but I expect you stumbling upon random puzzling issues.
Bottom line: Avoid committing the dependencies into your own repository if possible.
Try using the -force option, you will also most likely need to delete the .git directory inside the HTMLPurifier directory too.

Can't add new file to repository in EGit

I'm using EGit with Eclipse Juno.
I worked with a local repository and the world was good.
Even adding a GitHub repository seemed to be fine. I added it to my local repository under "Remotes", so I can easily push commits to github.
But after a while, I noticed that no new files are added to the repository, even if I'm commiting changes.
They just are not under version control. They have no symbol, which should mean they are ignored.
This is my .ignore
.gwt
gwt-unitC
ache
Versandanzeige_Web_proto.war
Versandanzeige_Web.war
war/ajax
war/WEB-INF/classes
war/WEB-INF/deploy
www-test
The files are in src, so not even close.
The new files don't appear in the Commit-Dialog, even when checking "show untracked files". They don't appear in the Staging-Window.
RK -> Team -> "Add to index" doesn't help.
The files have the same right and are owned by the same user
They definetly dont show up at github
Any ideas how to fix that? Any additional information needed?
Update:
There are no errors in the error log.
I do have (HEAD) next to my newest branch.
More details:
I got my trunk T, beginning at T0. At T1, there is a branch A, which has changes to T1.
At T2, there is another branch, B. It has no changes to T2.
The strange thing: it is not indicated in History view. The master branch is also missing.
I can still switch to them. When I do git reflog, there are no entries before or including T2, just everything afterwards.
I removed the branches without commits:
The new files are still shown as ignored:
Output from command line:
$ git branch -a:
* master
maven
$ git status
# On branch master nothing to commit (working directory clean)
About the detached HEAD proposel: I didn't do what is described in the article, checking out an old state and work from that. And I can't see any undone commits.
Sorry for my bad english, I didn't use it for a while. Please ask for clarification, if I write something hard to understand.
Update:
I could add a file in another folder (/Versandanzeige_Web/war/WEB-INF/lib/gwt-servlet.jar).
Alright, I found the error.
For some reason I don't really know, there was another .gitignore file ABOVE my Project folder (in repository folder), where my COMPLETE project folder was included. I really don't know how that happened. Of course, this file didn't show up in Eclipse.
I tried to add the files on the command line, but gut the error message "File is in .gitignore file".
After deleting that file, it worked find.
Sorry for the trouble.
Sometimes EGit does not work properly and add to index does not work. In that kind of situations you can go to the root folder of your project (where .git folder is placed) with a file explorer, right click on an empty area inside the folder, select "git bash". This will open the git console for you. Now type "git add path_to_file". This will add the file to the git system for indexing. Now go and refresh your project in eclipse and you will see it is added to the index. This can be used wile resolving conflicts inside eclipse because adding to the index indicates "mark as merged" to the git system by re-adding the merged file.
Also sometimes the "Remove from index" does not work in eclipse, you can do the same thing in that kind of situation: this time write "git remove --cached -f path_to_file". Here do not forget to add "--cached" because otherwise your file will be deleted. -f stands for "force" to force the command. For any folder (directory) to remove from index type "git remove --cached -r -f path_to_folder".