Access Keys:
Skip to content (Access Key - 0)

QuickStart Git

Labels

git git Delete
appfuse appfuse Delete
maven maven Delete
eclipse eclipse Delete
vcs vcs Delete
versioning versioning Delete
svn svn Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

QuickStart with Git

In software development, using a revision/version control system (VCS), such as Subversion, is highly recommended. A revision control system should make each developer's life much easier, whether you're an individual developer, or a team of developers.

These instructions provide a step-by-step walk through of getting a new project into Subversion. They assume that you have Git (command line) already installed.

Create your Git Repository

1. Create an AppFuse project.
2. Change into the directory where you created your AppFuse project

cd appfuse

3. If you have already run one of the following commands:
mvn jetty:run
mvn jetty:run-war (or mvn jetty:run)
mvn integration-test
mvn test

then you'll likely have build artefacts in your AppFuse project directory. Its a good idea to remove these artefacts from your project directory before creating a Git repository. To clean your AppFuse project directory, type:

mvn clean
Useful Information
Although you can ignore and remove files in your repository at any time, there is no need for them to be in the versioning history in the first place.

4. Initialize a Git repository:

git init

5. And that is it! Because this is distributed version control, you can make commits straight away and there is no need to connect to an external server.

6. If you didn't run mvn clean in step 3, then remove any build artefacts, logs, etc.

git rm *.log
git rm target/*

git commit -m "Removing log and build files from the repository"

7. Add file ignores for the following working files:

touch .gitignore

Open .gitignore in your favorite text editor and add the following lines:

.DS_Store
*.log
target

Then add and commit the .gitignore file to the repository.

git add .gitignore
git commit -m "Ignoring log files and all files in /target"

8. You should be all set to start making changes to your project, and then
commit the results every time you make a substantial change.

9. If you don't want the only version of your repository to be on your local computer, you can create a remote repository and periodically push your commits to it. A popular site for hosting Git projects is https://github.com/ (although other commercial and non-commercial sites exist, and its fairly straight-forward to host your own git server).

As an example, to setup a remote repository for the first time:

git remote add git@github.com:username/appfuse.git origin

Then to push changes to it:

git push origin master

Resources

http://git.or.cz/course/svn.html

Adaptavist Theme Builder (4.0.0-M8) Powered by Atlassian Confluence 3.1, the Enterprise Wiki.