Friday, April 22, 2016
How to have TFS version control not ignore .DLL and .EXE in the packages directory.
The easiest way to do this is to create a new .txt file in the packages directory and call it ".tfignore.". Notice it starts and ends with the period. The last period will be removed automatically and you will be left with a file called ".tfignore".
You can also use notepad.exe to create the file. The trick with this is to change the type to All File and just type the name ".tfignore".
Once you have a file created open it in notepad and add the following lines to it.
!*.exe
!*.dll
The ! tell the source control to NOT ignore the files with these extension.
Tuesday, April 28, 2015
Understanding GitHub
Let's walk through the diagram in detail. The first thing to notice in this example is that there is an existing repository called AwesomeCode in github.com in the account for user Jane. The goal is that all changes will end up back in Jane's repository (repo). If your goal is not to contribute to the main repository and just want to work on your own copy (aka fork) that will not affect the main repo at all you don't create pull requests. The steps below assume you would like to contribute to the main repo (Jane's).
1. Fork - A fork is like a branch or a copy of the main repo. To fork a repo you need to use github.com and click the fork button. This will not do anything to your laptop. It will copy the main repo to your github.com account. Notice the difference in the urls for the main and your forked copy.
2. Clone - When you clone a repo you are getting a local copy of it on your laptop. You can use github.com to do this or you can use GitHub for Windows. When you do this you will need to specify the directory where the repo will be located. This command will create files in the specified directory, but it will also create a .git directory in that same directory you specified. This is known as the Local Repository or Index. The name index because there is and Index file in the .git directory.
3. Modify File - Here is where you use your favorite editor or program to modify or create a file.
4. Save - This is simply using your favorite editor or program to save the changes you made to the file to the local disk. If you re-open the file you will see the changes.
5. Commit - Commit in GitHub is different than in Subversion, CVS, etc because you don't have to be connected to the internet, cloud, network, etc to commit the change. All your commits will be done to your Local Repo. This make working with GibHub very efficient for networks with latency. Commits are not visible on the main or even your repo on github.com yet. If your laptop was lost so would your changes.
6. Push / Sync - Push is what the command is called, but in GitHub for Windows it is the Sync button. When you Push / Sync the changes on your Local Repo are pushed (similar to a commit) to your repository on github.com. You changes are now visible on your repository on github.com, but it is NOT visible in the main repository (Jane's). If you don't want to make your changes available to Jane then you are done. You have updated your repository.
7. Create Pull Request - A pull request is a way to say to share what you have done with others. You can use the pull request to get approval for your change, or get feedback, or help, etc. Other users can then comment on your pull request. It is the last step before merging your changes with the main repo. A pull request is a made while on your repository on github.com or you can now use GitHub for Windows to do it, but the pull request is actually available on the main repo (Jane's) under Pull Requests. Try to keep your pull requests small (5-10 lines or changes) and descriptive so other people can understand what your were doing.
8. Merge Pull Request - When you want to incorporate a the changes in a Pull Request into the main repo you need to merge the changes. Sometimes it can be automatically done, but other times it can't. Once the changes are merged the changes you made in your Pull Request are now part of the main repo. The general rule is that no Pull Requests should be merged into the main repo unless they are ready for releasing to production.
Thursday, August 7, 2008
Basics of Subclipse when starting a new project
Subclipse is a plugin for Eclipse that adds a GUI in Eclipse to perform the basic functions of Subversion (like CVS or Visual SourceSafe (VSS)). Basically if you want to use Subversion while in Eclipse, Subeclipse is the tool for you.
This entry assumes that you have a Subversion repository already setup. It does NOT assume your project is in Subversion though. It does assume you already have a project in Eclipse though. In my examples, the name of my Eclipse project is called MyApp. Below are some basic things you should know where to find, but does not really get into Subversion features and how to use them. This entry assumes you know what Merge, Update, Commit, etc are used for, and how to use the other Subversion version control concepts. By no means is this a comprehensive look at all the features. It is really a view of things I use often or can't remember when I do them when I get a new project or start a new project. :)
Adding your project to Subversion.
Make sure your project is actually open (not closed), otherwise the Share Project... menu item will be disabled.
While in Eclipse, Go to the Package Explorer and right-click on MyApp (or whatever your project is called). Go to Team | Share Project...
When prompted select SVN as the repository type.
When prompted select your existing repository location, or create a new one if you don't have one already.
When prompted, use a custom path and append /MyApp/trunk to the path instead of just the default of /MyApp
Enter a comment like Initial import if it is not already specified.
When prompted select the files you want to add to source control. This should exclude any files that are specific to other version control systems such as VSS or CVS.
I would also highly recommend creating three remote folders (branches, tags, and trunk) under the project you just created in SVN. To do this do the following:
Go to the SVN Repository View (you can add it by going to the Window | Show View | SVN Repository menu item if it is not already visible.
Right-click on MyApp project in the SVN Repository View and choose New | new remote folder.
Enter branches
Then do the same for the other one tags
When you are done you will have a hierarchy like the following or something similar if you did not put yoru project at the root of the repository.
- svn://mySubversionServer/MyRepository/MyApp ---- branch ---- tags ---- trunk
Using Subversion operations on a file
Subclipse does a very nice job of integrating Subversion into the Eclipse IDE. To perform operations of a file simply do the following.
In the Package Explorer right click on the file you want to work with.
Go to Team and then choose the operation you want to use. This includes things like Merge, Commit, Show History, get the latest using Update, and a few other features as well.
Useful Perspectives
Subclipse includes some useful perspectives that may not be visible to start with. You can find them by going to Window menu Open Perspective Other...
This will show a window with a list of perspectives.
Click the SVN Repository Exploring and click OK. It is good to see all the projects in the repository or have direct access to the Repository.
Do the same for Team Synchronizing. Team Synchronization has the Synchronize view in it.
If you don't see them, click the Show all button in the Open Perspective window. There are also two other menu items that are of use when you right-click a file. They are the Compare With and Replace With menu items.
Adding a project from Subversion
This handy if you have a new machine, re-installed Eclipse, or just adding a project to Eclipse workspace that someone else put in Subversion and you need to work on now. To do this, do the folowing.
File menu New Other SVN folder Checkout Projects from SVN.
Walk through the wizard until it is finished.
If you want more information on Subversion operations, and installing subclipse see the link below.
http://www-128.ibm.com/developerworks/opensource/library/os-ecl-subversion/
Wednesday, August 6, 2008
Getting Started with Subversion Command Line
Tuesday, July 29, 2008
Automatically label releases to production using Visual Source Safe
When I move a project from my computer to the production server I like to create a label in Visual Source Safe (VSS) that notes the date and time and that something was deployed. This allows me and others to always know what is in production and how long it has been in production. It also makes it easy to do a bug fix. It is nice to have this at the click of a batch file. Otherwise, I am just to lazy most of the time to wait for VSS (it is on a slow connection so it takes a long time to load or do anything), remember to check in my code, find the project I am working on, then create a label, and type in the date and time and try to remember the format of my label so that is the same. Here is the code I put in a batch file (just create a text file and change the extension to .bat) using my favorite text editor. For more information on how the NOW variable is populated and limitation on it, see my other entry at: http://justgeeks.blogspot.com/2008/07/getting-formatted-date-into-variable-in.html. If you are not using US English data format you will definitely need to change the line that sets NOW to work with your locale. Also, you will need to adjust the paths in this script to match your environment.
@echo off set NOW=%date:~10,4%-%date:~4,2%-%date:~7,2%--%time:~0,2%.%time:~3,2% echo Please make sure all changes are checked in pause set SSDIR=\\myVssServer\someDirWhereIniFileIs"C:\Program Files\Microsoft Visual SourceSafe\ss" Label $/MyVssProjectPath -LDEPLOYED-%NOW% -C- echo A label has been created in VSS called: DEPLOYED-%NOW%