The [[E4/Git|e4 Git page]] has some helpful scripts and additional information on tagging

The [[E4/Git|e4 Git page]] has some helpful scripts and additional information on tagging

−

−

To manually tag, use '''git tag''' from the command line or the [[EGit/User_Guide#Tagging|eGit Tag Dialog]]. To push your tags to the remote repository, use '''git push --tags''' from the command line or the following steps for eGit:

−

−

# Team > Remote > Push...

−

# Click Next to get to the Specifications Page

−

# Click Add All Tags Spec

−

# Click Finish

= Commit changes to the main repo =

= Commit changes to the main repo =

Revision as of 00:46, 7 October 2011

We'd like to capture some common CVS workflows used by the Eclipse Project and spell out the git/EGit equivalent. Please read this page even if you don't use EGit. It contains important instructions on how to setup your repository.

Please read some of Pro Git to get a feel for how git repositories work. Refer to the EGit/User Guide for more detailed instructions and pictures.

Configure the workspace

Open the Team > Git > Configuration preference page and on the User Settings tab add the user.name and the user.email property. If you don't want to share your e-mail you can also use your committer account ID. Note that you will not be able to push changes to the the repository if the latter property is not matching with your records at the Eclipse Foundation.

Set New text file line delimiter to Unix on the General > Workspace preference page.

Finish - Now just sit back while git copies the entire repo to your harddrive :-)

Configuring the repo

Unless you are working on topic branches, we work in a fairly linear history. Please set branch.branchname.rebase = true (see instructions below).

Make sure that you set core.autocrlf=false and on Windows core.filemode=false. If you use EGit to clone the repository then this is done automatically for you.

Once you've cloned a repository, you can go to the Preferences > Team > Git > Configuration page. Select your repository, select the branch you picked when you cloned the repository and click New Entry.... Append "rebase" to the text in the 'Key' field and enter "true" as value.

To automate the setting of "branch.branchname.rebase = true" if you use command line git, add "branch.autosetuprebase = always" to your global user settings. Unfortunately, this does not yet work properly in EGit, see Bug 345536.

Importing the projects

We need to get the projects from the repo into our workspace:

right click on your newly cloned repo and select Import Projects

you want Import existing projects from the Working Directory

Next

Select the projects that you want to import from the repository

Finish

Now you can start working.

A note on deleting projects

Typically you will only want to have a subset of the projects from a given repository in your workspace. When you are no longer interested in a project, you can delete it from your workspace. However, NEVER select 'Delete project contents on disk' for a project in a git repository. If you do, Git will consider this an outgoing deletion to be committed to the remote branch. Later while working on a completely unrelated project you may accidentally commit this deletion (and you wouldn't be the first to do so).

Start working in HEAD

To start working in HEAD you must clone your repository and checkout a working copy. By default, cloning the repo checks out the master branch, which is the same as HEAD in CVS.

right click on one of your projects and choose Team>Switch To>New Branch

you need to pick a source ref.

HEAD == current checked out commit

refs/heads/master means your master branch.

refs/remotes/origin/R3_7_maintenance - the existing remote branch. If you pick this one and name your local branch the same, EGit will automatically create a tracked branch.

refs/tags/R3_7 is the tags to branch from

name the branch R3_7_maintenance

select the Rebase merge option

leave "Check out the new branch" selected.

This will create a new branch for you to work on. Once you've made your initial commits, you need #Commit_changes_to_the_main_repo. Pushing up to the repo will push any new branches you've created as well.

Tag the mapfile for a build

We're still deciding on a best practice on tagging the repos and updating the map files for an I build.

One option under discussion is to allow the I build to tag the repos and update the map files automatically based on master. In the normal case, the build will run with master. If we need a fix, a map file can be reverted and a new I build with "no repo tagging" can be started.

When we have a bug for the discussion I'll update this item with the number.

The e4 Git page has some helpful scripts and additional information on tagging

Commit changes to the main repo

Committing a change to the main repo is a 2-step process in git. In git, a commit creates a commit with the changed files in your local clone repository. A push will put that commit in our main repo. Committing and pushing are distinct operations in git.