I am using gitkraken V2.0.1 and it is auto scanning my disks for git repos, even those in my backup folders. How can I stop gitkraken from doing this?
In Preferences -> General, you can specify a Project Directory, which GitKraken scans for projects recursively.
With just C:\ as in this example, it will scan the entire disk. Try using something more restrictive to avoid your backups etc. from being included.
I had the same problem even though my 'projectsDirectory' in Preferences -> General had not changed since updating to 2.0. Re-setting the projects directory again to the same folder seemed to fix the problem.
Related
so I have updated my version of IntelliJ and Jetbrains decided to create new files and folders on my code folder. (see screenshot below)
I don't really want Jetbrains/IntelliJ clogging up my repo so I decided to add this entry on the .gitignore on the parent folder (e.g. /Users/myuser/Documents/myrepo/.gitignore)
##########################
## Jetbrains/IntelliJ
##
.idea/
.idea_modules/
*.iml
My problem with Gitkraken is that it continues to show all files and folder (as unstaged) inside "/Users/myuser/Documents/myrepo/.idea" even after I restart the app. I'm not sure if this matters but I am using the Gitkraken macOS version.
Some things to try:
Commit your .gitignore first. (Just a guess)
There is an option in GitKraken to ignore files individually, Right-Click (on the unstaged file) -> Ignore. This will add it to .gitignore.
The best way is to use a global ignore file like what is demonstrated here
GitKraken reads the global ignore file as well as the ignore files in the repo.
It does require a little bit of command line use but not much.
create a file in your home directory touch ~/.global_gitignore
add things like the .idea and other things in that file you never want in any repos (including OS specific things) see https://github.com/github/gitignore for many helpfil things to add
run the following command git config --global core.excludesfile ~/.global_gitignore
Enjoy never needing to exclude them from your repos again.
I used computer A via the Terminal to create a) create a git repository, b) add an index.html file to the repo, c) add a remote origin, d) push to the remote origin. All OK.
Then, i used computer B to clone that repository via Terminal. Then, I opened Eclipse (equipped with Egit), and created a new project in the folder that was created by the cloning process. Then I used Eclipse to push any changes to the remote origin.
Returning to computer A, I used Eclipse to create a project in the original repo folder, and then I attempted to pull from the remote origin, in order to get the changes that were pushed when using computer B.
Eclipse will not do it. It complains the I have items such as .settings, .project and similar and since they are not under version control it won't overwrite them by fetching files from the server. I had to manually delete those files (via Terminal) and then Eclipse worked as expected.
Please provide information on how to avoid this.
Should I create the local repo from within Eclipse and then push it to the remote origin, so that items such as (.settings) are under version control and (if so) how would that cause trouble to people cloning the repo and use different versions of Eclipse?
Should I gitignore those items?
Should I ask Eclipse to save its own affiliated files to another folder (not that i am aware how to do that, i only know that NetBeans does it)?
Looks like you didn't gitignored eclipse files.
Probably, when you commit/push via egit, you also commit and push those files you already had unversioned in your machine A, so git complains, because you are asking to override existing unversioned files.
I strongly recommend you to gitignore those eclipse files. You can see examples of .gitignore files in the github gitignore repo.
Hope it helps.
It complains because if you pull the changes from your remote it will overwrite your local files. That is the problem. The other answerer has right. You should better add all the eclipse project files and and target .settings and classpath to gitignore. You can use a global gitignore for your computers as well, before creating projects. You could use maven for example, then you can import your projects only from the pom.xml-s given in the git repository.
I use them the same. Egit and other guis are a bit too complex to work with. Git repositories can get easy in an inconsistent state where you should use the oldfashioned terminal to solve things. Like, rebasing, merging on conflicts. Gits learning curve is solid.
Now you can solve your problem if on the first computer save a backup of your original and clones your project later, after fixed it on the second. On the second git remove all this files, but use the --cached option to avoid deleting them. Before you do it so, check the help of git remove! after you have done this, put them into the .gitignore as filenames with wildcards. You can also use a global gitignore file in your user folder. Creating a .gitconfig file where you can specifiy the global ignore with the following :
[core]
excludesfile = ~/.gitignore_global
Than just create the .gitignore_global like this :
/nbproject
/bin
/build.xml
.idea
chess.iml
target/
bin
( This file is for idea and netbeans. you can add eclipse project files here )
You can have .gitignore files per project too. You can commit them to the repository, so on the next machine you do not have to do this again. The nicest way I think is having a dotfiles git repository, which is a git repo of your home directory and the dotfiles in it. I also use it for different windows and linux distros.
That's all. You should keep all of your configuration in a safe place. And source code management can do it. But do not commit private stuff to public a place! ;)
Oh I wanted to mention that, you can also have a .gitignore entry in your .gitignore file. That can be very useful when you do not want to touch a repository but need to add a gitignore to hide some stuff especially from the given repo.
Using the combination of tools in the title, when I check out a branch, SourceTree/GIT will:
Definitely NOT delete folders from the previously checked-out branch, so if I have BRANCH-ALPHA with FOLDER1 and FOLDER2 and then I check out BRANCH-BETA which has FOLDER2 and FOLDER3 only and no FOLDER1, the resulting structure in FINDER will show that FOLDER1 is still there. Can reproduce this over and over.
Often will not even overwrite files from the previously checked-out branch, so that I'm still seeing BRANCH-ALPHA in Eclipse when I have checked-out BRANCH-BETA.
I close Eclipse before doing the checkout, and then open Eclipse, CLEAN and BUILD everything. It's really a problem with GIT.
The only "solution" is to delete all the folders and all the metadata and then check out the branch. This typically leads to a few hours of trying to "convince" Eclipse to open the project, creating a new workspace, new metadata, etc., and then fixing a lot of things like paths etc.
Any ideas on how to further research the cause and find a solution are very much appreciated.
Git only deletes empty folders when checking out a new commit. You might see apparently empty directories because there are hidden files stored in them. If you try to monitor the behavior by opening them in Finder, you're actually causing the problem since Finder creates hidden files to track the way the folders are displayed.
Does it really bother you that the folders are there? You could add a post-checkout hook that runs git clean -dxf after each checkout; this will remove all the files that are not known by git. Be careful that it will also delete compiled classes, so a new build will be required.
Another possibility is that something is locking files or directories, so git can't remove them while they're still opened/locked by the other program. This would also explain why some files aren't updated to the right version. Does git complain when you switch branches? It should if there's indeed a lock on the files.
Using the Egit plugin, is it possible to permanently remove a file from source control without deleting the local copy?
I.e., is there a GUI action equivalent to running "git rm --cached"?
(Edited to simplify question)
I have found the answer. Team->Untrack is indeed the equivalent of "rm --cached". However there is a known bug which produces weird behaviour when you untrack and then try to commit.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=363405
Team -> Advanced -> Untrack
did the job (git rm --cached) for me.
I had the same problem, after not initially including directories and files in .ignore. I also tried "Untrack" and "Remove from index" possibility, non of which helped(due to the still unresolved Egit issue).
So, in the end I deleted files locally (leaving the project all in bugs), committed and pushed it to the github, and then undid the delete locally and added files to .ignore.
Very unelegant, but it worked.
I lost a lot of time and nerves on it, and I hope this helps someone.
Another option, similar to what Sri Sankaran suggests in the comments, is to update the index in order to assume no modification to your config file:
On the preferences, in Egit, you can list "assumed unchanged" files
:
The file remains versioned and on the disk, but no modification will be detected on it.
If you need to delete invisible folder(or file) from eclipse project:
Add folder(or file) to .gitignore file;
Replace folder to another directory
Team add to index, commit and push
Replace folder(or file) to the project folder
I hope this is OK to ask here instead of superuser since I get very little response there to very specific questions like this.
I have a project that's under mercurial revision control and I'd like to move where it is located on my computer (from ~/workspace to ~/Dropbox/Projects). But if I move the project and then re-import it, it loses the mercurial connection.
I can just commit, push, delete my project, and re-import from hg in the new directory. But there has to be an easier way, no?
I don't know specifically about Mercurial, but with some version control systems, moving a checked out copy of the code is very hard (some VCS keep metadata with absolute paths, etc.). So I would commit and re-fetch, personally.
Also, consider the possibility of losing that uncommitted work during the move...
When you move the project, can you confirm if the .hg subfolder (which holds the repository data) moved as well?
Is the moved repository accessible using a command-line or a different mercurial (say TortoiseHg) client?
In Eclipse, what happens when you do "Team -> Share Project..." again?