dbarbosa
dbarbosa

Reputation: 3049

Needing a git-svn workflow suggestion to keep personal files away from svn

I am starting to read about git-svn now to use it with a project that use SVN.

I would like to have some files just for me (todo files, scratch code, etc), and I will like to keep track of them in the Git repository. Is it possible to have some files in the Git but not in the SVN repository?

I though about having a branch master that will be synchronized with the SVN repository and keep my work into another branch (work), but then I will need to merge/rebase work into master before pushing changes to SVN and remove these files and commits/log messages related to them... seems unpractical (and I don't know how to do it).

I am also thinking about adding a lot of comments into the code as I am understanding it, but most of them I should keep just for me.

Does anyone have a workflow suggestion to keep some files away from the SVN repository?

Or should I just forget this idea and have another git repository for this?

Upvotes: 1

Views: 134

Answers (3)

user3276552
user3276552

Reputation: 1082

If you want your own stuff peppered throughout your git repo, take a look at mine.

Looks like it's sugar around the line *_mine_* in your global gitignore file, which lets you have a project structure like so:

project-root/
    tempBugList_mine_  # git will ignore this file
    readme.md
    _mine_/            # everything in this dir will be ignored by git
        notes
        promotion-ideas
    lib/
        fileone
        filetwo
    _mine_foodForThought    # ignored by git too!

mine can snapshot, clean, and restore those *_mine_* files & dirs git clean and friends can't blow away your personal stuff.

Upvotes: 0

Adam Byrtek
Adam Byrtek

Reputation: 12212

Don't be afraid to branch and merge, this is extremely easy with Git. Just keep the local changes on a separate branch, let's call it play, and do the rest of your work either on master (which I assume is synchronized with Subversion trunk) or feature branches.

After pulling new changes from Subversion you could rebase play on top of master to get the latest code and resolve potential conflicts. If you change your mind and decide that some of play changes should be published, you can always cherry-pick individual commits on top of master and push them to Subversion.

Upvotes: 1

Carl Norum
Carl Norum

Reputation: 225212

Why do your todo files and so forth need to be in the same repository with the rest of the code? Just make a new repository somewhere else on your machine.

Upvotes: 0

Related Questions