For my job i'm working with starteam.
But I want to try using svn. So in a first time I installed tortoisesvn on my pc (windows 7 home premium x64)
I have that directory :
c:\svn\lab
On that directory I do :
right click - tortoiseSVN - create a repository here
Then I have
c:\java\lab
and I do
right click - SVN checkout - and choose my local repository file:///c:/svn/lab
In c:\java\lab, I create that structure
│ a.txt
│ b.xlsx
│
├───target
└───test
│ c.txt
│ d.xlsx
│
└───target
and I want to ignore txt files and target directories.
If I do
right click - svn commit
in the commit dialog all files and directories are in the list -- ok it's normal.
Now I tried
svn propset -R svn:ignore *.txt .
in the commit dialog, a.txt is not there (cool it's working) but c.txt is still there !!
Idem with target directories.
How can I do ?
Right Click on top Directory > TortoiseSVN > Properties.
In the properties window, check if directory contains svn:ignore property. If doesn't, Click 'Add', then set property name svn:ignore and property values:
*.txt
target.
Otherwise, double-click the property.
Check 'Apply Property Recursively'. Click 'Ok'.
Related
I would like to ignore all files like .sddr09.o.cmd or .karma.o.cmd etc onto a kernel svn repository.
I try somme commands like :
svn propset svn:ignore '*.cmd' . --recursive
or
svn propset svn:ignore '*.o.cmd' . --recursive
or
svn propset svn:ignore '.*.o.cmd' . --recursive
but no one success to prevent from commit these files.
So I try to use the dontdiff file located in linux/Documentation/dontdiff appending
*.cmd
*.o.cmd
.*.o.cmd
at the end of the file
and I use the following command line :
svn propset svn:ignore -R -F Documentation/dontdiff .
but no more success.
Any Idea ?
You mention in the comments that you've already added these files, so the first step is to undo that. Presumably you used svn add to add the files, so you'll need to use the inverse of that: svn delete.
svn delete --keep-local path/to/file
The --keep-local will tell SVN not to undo any modifications you've made. If you do want to reset the files to their original state (or delete them if they didn't exist before), you can omit the option.
You can confirm this with svn status. The files in question should not have anything in the first column.
After that, you should be able to run the svn ignore commands that you included in your question.
I am using to track changes to some linux system files (/etc/*), I had the .git in /etc
but now I decided to move it to / as I want to track files that are outside /etc (both /etc and / are in the same filesystems...), I did that and tried to re-add the same files with:
git add $(git status | awk '/deleted/ { print "etc/"$3 } ')
But it does not appear to be working as I hoped as now the are two lists one with a list of "new files" and one with a list of "deleted files", if commit now I will lose all the history
for the files....
What would have been the correct steps?
Thanks!
Antonio
Use git subtree (installation instructions if not already installed).
Create a new repository at / and merge it with the existing one in /etc:
$ cd /
$ git init
$ git subtree --prefix etc /etc master
Ther are similar questions on SO:
My Git repository is in the wrong root directory. Can I move it? (../ intead of ./)
Moving a git repository
And there is no way of chaning directory without losing history of files.
I am new to Perforce. Could you add a new folder under the branch in the depot? I also tried to add one in my workplace but how could I get it to the depot? Do I have to do a merge/integrate or something?
Thanks.
p4 add doesn't support recursive add .
Here's a unix shell work-around to run from within the root folder you want to add:
find . -type f -print | p4 -x - add
If your server version is 2012.1 or later, you can use the reconcile command to do this, with full wildcard support:
p4 reconcile //depot/path/to/folder/...
From your local workspace, create your folder and a file you want to go inside it. Then either mark it as add from the visual client, or go into the folder from the command line, and type...
p4 add ./new_folder/new_file_name.ext
When you submit, the new file and folder will be in your repository. This assumes that new_folder is a subfolder of your existing workspace. Please let me know if it isn't and I'll update my answer.
Above command will add files under default changelist. And later if you want to see the if files are really added in default changelist
p4 opened
And for the submission of opened files, under the default changelist, to depot
p4 submit
Use command
p4 add directory_to_be_added/...
This will recursively add all contents starting drom "directory_to_be_added"
To add files from a directory in perforce
p4 reconcile -f -c [changeList] -a <dir_path_to add>
I had a situation that I need to add entire folder with files having wildcard name, so had to do it through command line using -f (force), I used "dir /b /s /a-d | p4 -x - add -f"
If you are using p4v to add a folder recursively, you need to click on:
"Connection" -> "Edit Current Workspace"
then manually add the mapping of the new folder to your depot.
Then go to your "Workspace" view and right click on the root folder, click "Mark for Add" and comment. All the files under it should show up in the new pending change list.
Here we can see that SVN is not adding files that need to be added, and not committing:
$ ls -la forum
drwxr-xr-x 6 dotan.cohen coders 4096 Apr 9 02:09 before
$ svn status
? tags
? forum/before
$ svn add forum/before --force
$ svn status
? tags
? forum/before
$ svn commit -m "Some Comment"
$
The first command (ls -la) shows us that forum/before/ is in fact a directory. The next command svn status shows us that the directory is not under version control. The next line (svn add) shows an attempt to add the directory to version control, and the line after it shows that the directory still is not under version control. The last line shows that an svn commit does nothing, i.e. no commit.
I can confirm that the directory in question is not added to the repository. Why might that be, and how can I fix it? This is on CentOS 5. Thanks.
If you ever find yourself in this situation again, I would suggest using svn switch rather than deleting the .svn directories. This will re-point all of the URLs. The general syntax is switch URL[#PEGREV] [PATH].
The problem was that the directory in question was copied from another directory under version control. Removing all the .svn subdirectories resolved the issue. I used the following command to remove them (from within forum/before/):
rm -rf `find . -name .svn`
I'm not sure if this is the right place to ask this, please redirect me if not.
I'm new to git and while learning it I stumbled upon this.
How does git branch branchName and 'ls' work with each other.
For eg:
If I have a master and test branch and test branch has an extra testFile when compared to master branch.
Now, while in the master branch, if I ls, I'll wont see the testFile but after switching to the test branch and ls, I'll see the testFile
kiran#kiran-desktop:/media/kiran/Linux_Server/dev$ git branch
master
* test
kiran#kiran-desktop:/media/kiran/Linux_Server/dev$ git checkout master
M editor/editor_parts/syntax/operator_syntax.js
Switched to branch 'master'
kiran#kiran-desktop:/media/kiran/Linux_Server/dev$ ls
cgi-bin index.php misc underConstruction
editor jquery-1.5.2.min.js php.php userManage
fileManage jquery-ui-1.8.11.custom.css projectManage userPages
images login test.php
kiran#kiran-desktop:/media/kiran/Linux_Server/dev$ git checkout test
M editor/editor_parts/syntax/operator_syntax.js
Switched to branch 'test'
kiran#kiran-desktop:/media/kiran/Linux_Server/dev$ ls
cgi-bin index.php misc test.php
editor jquery-1.5.2.min.js php.php underConstruction
fileManage jquery-ui-1.8.11.custom.css projectManage userManage
images login testFile.txt userPages
kiran#kiran-desktop:/media/kiran/Linux_Server/dev$
But pwd from both branches shows the same location.
So, how does switching branches change the output of ls ( which as I understand is a function of linux) ?
git checkout switches you from one branch to the other. To do this, it replaces the files in the checked out repository with the ones from the branch.
Your repository is effectively the .git subdirectory.
If you do a ls -a, you'll see it:
% ls -a -1
.git
.gitignore
...
Tracked files are stored in there. You normally only see the currently checked out branch. When you checkout a different branch, git grabs the files from .git and you can see them with ls.
Have a look at the answers to this question for more information about how git works: Where can I find a tutorial on Git's internals?
Git, unlike in SVN what you know keeps branches in different directories, keeps only the current working branch in the repository directory.
All the branches (Actually, all the objects) are stored inside the '.git' folder in the root of the repo and only the files belonging to the specific branch are present while you have checked out a specific branch. (and those files that are not added to the repo)