I'm starting to use Android Studio as a git client for my projects. But I cannot find where I can set global .gitignore file for filtering files on any project by default.
The same is done in SourceTree in tools-options-git-global_gitignore_list.
Create a file listing your git ignore patterns and configure it as the global excludesfile. For example, if you're on a Unix-like system and have a .gitignore file in your home directory, you would run:
git config --global core.excludesfile '~/.gitignore'
Android Studio should pick it up automatically (although you may have to restart it). Make sure the git client on your command line is the same as the one AS is configured to use.
Related
Currently i am using Android Studio version 2.2.
Once we add configuration file into .gitignore file of project root directory and then make any changes to ignore files, Still it shows these changed file while committing.
So how can we avoid these files from showing up while committing.
I have tried removing ignore files file from Setting->Version Control->Ignore Files , And restarted the Studio.But is doesn't work.
I have tried to removing previously cached file from git rm -r --cached .
And then re-added the gitignore files and added the project again.
But still all the git ignore file shows while committing and leads to problem by mistakenly selecting them.
Anyone who have faced this please guide to remove these git ignore file while committing in Android Studio.
Have tired this but didn't get any help.
You need to remove (or "ignore") these files from version control.
One option is:
Close Android Studio;
Remove the files that you need to remove from vcs (probably something like rm -rf .idea/);
Commit your changes;
Make sure that all files that you want are on your .gitignore;
Reopen Android Studio;
Now he will create all files that he needs to execute, such as .idea folder, but you don't need to worry because now they are out of version control.
Using Android Studio:
To keep my source directories small, for google drive backup etc, I found how to specify a global gradle build directory outside my project directories here:
Gradle global build directory
Is it possible also to put the rather large .gradle/.../taskArtifacts directory outside the project directory.
Set --gradle-cache-dir when invoking gradle from the command line.
I am using Subversion to manage my python code. But I have no idea how to put the file properties of my configuration file.
For example I have the configuration file checked in on my development platform. I want to make sure that
After the configuration file is being checked out. The SVN up process should ignore the modified configuration file.
On the server side I have the golden configuration file. Therefore the SVN commit should ignore the configuration file as well.
I have no idea how to set the properties of the configuration file so I am seeking help here.
Thanks in advance
This comes up enough that it's in the Subversion FAQ
Short version: Create (and version) a "template" configuration file. Users check out a WC, make a filesystem local (not svn) copy which is to be ignored by Subversion, and then modify that copy.
You might want to look at my pre-commit hook.
But first, uou need to remove that configuration file from your Subversion repository. Instead, add a configuration template that developers can copy and use.
Once you remove the configuration file from your repository, you want to set svn:ignore to ignore it. This way, it doesn't accidentally get added if a user does a svn add * or sees it when they do a svn status.
However, if you want to be absolutely certain that this configuration file is never added to the project, you need a pre-commit hook that will refuse a commit if a user does add it.
Why don't you tell SVN to ignore the file?
$ cd path/to/config/file
$ svn delete --keep-local config.file
$ svn propset svn:ignore config.file
$ svn commit
What this does is first tell SVN that it should stop tracking the file (svn delete), then we set the svn:ignorepoperty on the directory in which the file resides, and then we commit these changes.
If you still want the configuration file to be tracked by SVN, then you can either commit your changes excluding the modifications on the file, or external the file in and be sure to ignore externals when committing.
I'm setting up buildbot to build a project. The project's code is stored in SVN and it uses a couple of libs in our SVN repository.
When performing a manul build, what I need to do is (of course) to checkout the main project and the libs. The command used to checkout the libs is something like:
svn co svn://<path_to_lib_repo>/trunk mylib
That way the code of the library is stored in a local folder called "mylib" where the makefiles will look for.
Is there a way to configure the SVN build step to have the code checked-out to a folder with a custom name, as above? I did not found a way so far.
As a (temporarly?) workaround on Linux, I'm using the ShellCommand() step building myself the svn command, but I really don't like such solution.
Use the workdir paraemter to set the directory where you want the files. For example:
f.addStep(SVN(name='pull.src', repourl=svn://<path_to_lib_repo>/trunk,
workdir='mylib',
description='pull.src'))
I have a linux eclipse project checked into our company svn. Works great.
The project is intended to be cross compiled on Windows.
Untill now, I have simply moved the source files between OSes. However, I thought I'd like to let svn do this for me. Should be simple enough, just checkout the eclipse linux src into the VS project dir, right? Wrong!
The correct source was checked out of svn and it worked fine. But when I tried to check it back in i kept getting "Commit not completed filename remains in conflict" errors. I hadn't even changed anything!
Did a little checking. Turns out the linux src directory is pretty much just the source and headers. On the MSVS side the project directory contains the source and headers but also contains a bunch of files that are used by VS with names like projname.vcproj etc. etc.
So, I did a checkout into a scratch dirextory, .\fred. Checked .\fred back in. No problems. Added a new file to .fred, xxx.xxx. Check in reported:
svn: E200009: Commit failed (details follow):
svn: E200009: 'C:\Projects\fred\xxx.xxx' is not under version control
Makes me wonder about those uncommitted Visual Studio files.
So, are those files my problem? Are they breaking the commit operation?
As an alternate solution I am thinking of adding the VS files to the src dir in svn. If linux/eclipse checks them out I can tell eclipse to ignore them (I think it'll just ignore them for me). Any thoughts or recommendations for this approach?
(BTW, i still had fresh source on the linux side so any thing that got clobbered could be safely restored.)
So here is one solution I have working for the moment. I am not sure how totally stable it is.
Caveat: The project i am using already existed as a MSVS project.
In the MSVS solution dir, rename the source dir (MSVS likes the source dir name to match the solution dir name, so this means the source dir may not be named src) to something uninvolved in the solution, like temp.
SVN checkout the src (eclipse like to call source dirs src).
cd into the source dir. Issue the command:
svn changelist msvs *.cpp *.h
Add *.c if needed. "msvs" is the changelist name. It can be whatever you want ti to be.
This will created a changelist for the checked out directory.
Now, copy the remaining files from the temp directory into your source dir.
When you need to do a checkin, cd into the source dir and issue this command:
svn ci --changelist msvs
Note. You have to be in the src dir for this to work.