Welcome Guest, Not a member yet? Register   Sign In
Source Control In Netbeans - Of SVN and Git
#1

[eluser]BrianDHall[/eluser]
OK, so I have Netbeans all setup and debugging and my custom code folding defaults setup and such, and it works well. I've managed to setup Git with nbgit plugin and add my code and it seems to work great - but I can't figure out how to branch the bleepin' thing, which is of course kind of one of the big points of having source control.

With SVN I haven't fared as well, I somehow managed to add...a directory. No files, just a directory.

Has anyone used either of these inside netbeans and could point me to a good learning resource as I can't afford to spend days figuring out if it's a waste of time or time well spent.

Anyone found it better just to use external tools rather than let netbeans do it? I develop on Windows (Vista, ugh) and deploy to linux, but a tool that just works on windows wouldn't kill me.
#2

[eluser]bretticus[/eluser]
I used to have this problem until my work got me a macbook pro Smile Doesn't help you much but my point is that I have had much better success using the command line. Smile

AS for SVN, I think it was invented to torment unsuspecting persons into insanity. Yes, I still use it but I am thinking it's time to switch to git. Smile
#3

[eluser]brianw1975[/eluser]
with subversion in netbeans you don't "add" files in a conventional sense (nor do you have to "add" folders)... netbeans is smart enough to know that if you want to commit a file you also want to add it if it's not already under source control. so just right click on the (new) file and commit, when the dialog pops up you'll see the status says "Add"

As for branching and tagging and all that jazz, I would assume that you would need to use either the command line or a gui client to create them -- tortoise would be a good thing to use to do this kind of management in windows explorer as it has more fine tuned control.

EDIT: the same thing goes with moving/renaming a file - just rename it and netbeans is smart enough to know that the filename has been changed and that it should do svn move, same with copy (add)
#4

[eluser]jedd[/eluser]
I'm on the CLI side, too. Crank up a console and keep it running somewhere - amazingly useful things.

With git, you would create a branch like this:
Code:
$  git branch foo

This creates a branch called foo, but doesn't automatically check it out for you (in other words, you're still working in whatever branch you were before you ran that command).

You then need to do this:
Code:
$  git checkout foo

You can see available branches (* next to the currently selected on) by running git branch.

I think the CLI makes this easier, clearer and safer than any GUI possibly could.
#5

[eluser]BrianDHall[/eluser]
It does seem much easier to find answers on "How to do this?" that involve the command-line. I think I'm just going to start using it instead of seeking built-in integration in any IDE - they just seem rather poor in this regard, its surprising. I guess in another 5 years this might be a moot point, but for now it seems the best.

Thanks for the advice everyone, I much appreciate it!
#6

[eluser]Knitter[/eluser]
What exactly is not working for you?

From what I can read, it seems to me you never used a version control system, and no, making branches is not the reason to use a version control system, if that's your reason, you should stick with copying the files to other folders, no offense, just looking at it from an objective view.

SVN support in NetBeans IDE is very good, I would like some improvements into some UI actions but everything you need to work with SVN from an IDE perspective is there. Git support is somewhat new, though the module has been evolving at a fast pace.

I can't really point you to any how to on using version control inside NetBeans IDE because I know of none, the best way to learn about version control is to read the docs for the system you're using, Git or SVN.

I can give a few pointers on SVN if you need, I use NetBeans IDE and SVN both as my work tools and for any personal projects I have. As for Git, I haven't felt the need for it, it's strong points are not a requirement right now.

As for SVN, you need to understand that the system can only track the files you tell it to, NetBeans IDE can offer some support by assuming that you want to track every file, excluding any configuration used by the IDE, but in the end, you need to tell SVN that a given file is to be added for version control. The IDE will show new file, that have never been commited, in green, modified files, files that have been commited and have been changed since last commit in blue.

All SVN commands are under the "Subversion" option for the context menu, easier to access, and the basic commands would be update and commit. Branching in SVN is nothing more than copying files, so the command in NetBeans is named "Copy to", after copying/branching some code, you need to change to that new copy, the command is named "Switch to Copy".

For Git, every working copy is a brach, if you're the only developer, branching may not be useful, it really depends on what you're doing.

I'm really just "spiting" all that comes to mind here so bare with me for a while. My advice, read a bit about how version control works, specifically how Git and SVN work, as they are very different in implementation, nature, features, strong and weak points. After knowing how the version control system works, using a client is as easy as learning the name for the commands, either command line clients, or GUI clients, it's all the same. I prefer to use the NetBeans IDE client as I feel it makes me work faster, not having to go to the CLI, but CLI is just fine. My co-worker uses KDE integrated client, my boss uses Tortoise SVN, I use the NetBeans client, we all do the same thing (maybe my boss just makes a few updates to see if we are working Big Grin), bottom line, if it works for you, use it.

I could leave the link to my wiki, I have a small TortoiseSVN tutorial that you can look at, maybe it will be enough to show you the basics, http://wiki.sergio-lopes.org/index.php?n...VNTutorial, thought it's aimed at Windows users.

Sorry for the long, not so useful, post. If you have questions please feel free to ask them, and I'm not trying to sell you SVN Smile, it's just the one I use 8 hours a day, every work day...

Best regards,

Knitter




Theme © iAndrew 2016 - Forum software by © MyBB