SVN Ignored folder shows again and again - java

I have a local SVN folder which has many files/directories/sub-directories
One of them is Project-Ear, which contains generated folders/files that I do not wish to check-in at all..
I have marked this Project-Ear folder as "unversion and add to ignore list"
Now every time, I do SVN Commit, this folder Project-Ear and it's files show in the Commit dialog.
How do I fix this? I do not want this Project-Ear to be shown at all.

If the files were initially committed into the repo, you will need to commit the "un-version" part, at that point they will be removed from the repo, and ignored from then on local file systems.

Related

Can I reimport a deleated .git file without loosing code?

I deleted my .git file from my project. But, I haven't deleted my project folder. Can I still import ONLY .git file without reimporting the whole project?
I haven't tried anything I don't want to lose the code I have when deleting the folder and reimporting the complete project
To recover a file/folder from your system you need to look for some recovery tools.
But here is the steps, how you can save your uncommitted effort safely:
1- clone your project into another folder.
2- you will have the latest code with .git stuffs.
3- copy paste all files from old folder to new.
4- now you have overwritten only those files which are having change.
5- run git status to see the efforts intact.
Alternatively:
1- clone your project into another folder.
2- you will have the latest code with .git stuffs.
3- copy paste all .git stuffs from new folder to older.
4- now you have git back into your project.
5- run git status to see the efforts intact.
.git is the directory which maintains the version control for your source code. Delelting this does not affect to your source code + local changes.
If you need the git version control back again, easiest thing you could do is get a fresh clone of the remote repository and use a merging tool(ex:winmerge, araxis merge) from which you can identify your local changes) and then you can do a commit

Git ignore not excluding my .project file

I am using git for the first time and I am trying to make a commit. I want to ignore all .project and .settings files so I went to my .gitignore file and added .project, .settings and saved. When I did that the .settings file doesn't appear anymore, however, I still see my .project file when I do git -status. Also, why is the .xml and java file in a different section that the .jar files:
Your git status output is showing you two types of files:
Changes not staged for commit
These are files which Git is tracking, and these files have been modified since the previous commit. But, the changes have not yet been staged. Unless you stage the changes using git add, they will not be committed. Here is how you would stage the change to the web.xml file:
git add path/to/web.xml
Assuming you really just started working, then the most likely explanation for why the .project is showing up as being tracked by Git is that you somehow added it. To fix this, you can try using:
git rm --cached .project
This removes the .project file from being tracked by Git. It would also remove it from the remote repository, but since you just started working and haven't pushed yet, this is a moot point.
Untracked files
These are files which Git is completely ignoring. From Git's point of view, these files are not there. I can see that you have a number of JAR files listed as untracked, which is probably a good thing, since in general it is a bad idea to add binary files, especially dependencies, to your Git repository. Should you see a source file listed as untracked, you could also run git add to add that file to Git.
The reason it is generally considered bad practice to add binaries to a Git repository is that Git doesn't handle diffs of binaries very well. Suppose you add a 1MB JAR file. Each time it changes, which could be fairly often if you are doing some open source stuff, a diff has to be stored for that binary. But, Git often will interpret the diff as being deleting the old file and replacing it with the entire contents of the new file. In other words, Git basically versions the entire binary for each change. Over time, this can cause your repository to become large and bloated, and it can be difficult to get rid of those binaries from your history. So, unless absolutely necessary, avoid storing binaries in your Git repository.

Creating a new root directory in an Eclipse project under version control

I'm working on a group project for my software engineering course, and my professor has indicated that I set up the directory structure incorrectly on Github. I'd like to correct the issue now to avoid a grade penalty, but I'm very new to using Git. Basically we have a structure that is as follows on Github.
src
--main
----java
------Source Files
--test
-----java
------Test Files
Various Ivy/Ant build files
.classpath
.gitignore
.git
.project
README.md
I need to create a new directory called CodeComp that will contain the directory structure above except for the README.md, which should be on the same level as the CodeComp directory.
Since our grade is dependent on the commit history, this would need to be preserved. Is there an easy way to do this or are we better off just taking the small deduction on the final project grade?
UPDATE:
In case anyone else has to do this in the future:
Go to the folder holding the project and create the new directory.
Move all files needed into the new directory except .* files. Refresh Eclipse.
Commit and Push the directory changes to the repo regardless of Eclipse errors.
Manually delete the .classpath, .gitignore, and .project files from the repository.
Back-up your .classpath and .gitignore files. Delete your local copy of the repo and re-clone it.
Import the Git project and choose to put the project files in your newly created directory.
Copy the .classpath and .gitignore you backed up into the new project directory. Push the changes.
In theory you should be able to use a standard file browser to move everything but your .git and Readme file into your new sub-folder and then commit that.
The git history will still there but it may see it as two separate files, one that has been deleted and one that is just created. In my experience Git doesn't really like moving files.
In any case, you commit history will still be in the repository, it will just be 2 separate sections from when you moved the files.
But, hey... It may pay to show that move anyway. I know for sure that I was moving files all around when I first learnt about version control. It's all learning.
EDIT: You can test this by committing the change locally and checking the history before you push it upstream to Github.

what is the difference between ~/.gitignore and `git update-index --assume-unchanged`

I changed some settings in my config file which I don't want to push to the remote repository.
I want it to effect only one project locally.
I saw there are few ways to do so:
http://365git.tumblr.com/post/519016351/three-ways-of-excluding-files (1)
Per Computer: through settings in ~/.gitconfig
git update-index --assume-unchanged (2)
I'm using SourceTree and only when I use option (2) I see the files are vanished from the UI.
What is the difference between (1) and (2) ?
Does it really means that the files are not ignored when I see them in the SourceTree after using option (1) ?
The .gitignore file prevents files from showing up as files to be added to the repository. If the file is already in the repo when it is added to the .gitignore file, any changes to the file will be shown by git and can be committed. The .gitignore settings only affect new files that are in the repos path. You would use this for keeping temp files created by you IDE or compile files from showing up and cluttering your list of files that you modified when you do git status.
git update-index --assume-unchanged doesn't show that a file was changed at all. If you make any modifications to the file, git won't show that it has been modified in git status. You would use this with config files for users. When the repository gets cloned they need to have the file but there may be some changes that they need so that they can use the code (i.e. change a file path for their local machine). But you don't want them to accidentally commit the file and mess up things for others when they pull in the changes.
For changes to a config file, you want to use the git update-index option. You want the config file in the repo but you don't want to commit the changes to it.

Eclipse subversion svn don't upload a directory

I have a project that I need to upload to my svn server. There is a folder/directory that I do not want to upload to the svn server every time I commit my project.
Is it possible to make it so that subversion will automatically not commit the directory, or will I have to uncheck that directory in the commit dialog every time. The reason that I want this is so that I wont make a mistake and accidentaly commit the directory.
Thanks,
Aidan
Add a svn:ignore property to the parent directory, and set its value to the name of the directory you don't want to commit. Then commit the parent directory.
Looks to me that you need modifiable configuration directory.
The best way to do it is to copy files under source control into some temporary place and use that place as a source for your configuration.
This way SCM system will never pick up your customized environment settings.

Categories

Resources