Git

Git is a modern distributed version control system. Like SVN, it permits version control - but also much, much more. It permits disconnected operation and branching becomes much easier. While ELabs uses SVN for centralized version control, developers can use Git locally.

Setting things up

-- Main.PhongNguyen - 22 Jan 2010

Git-svn

Moving code from local_test to 4.0-ND-prod:

1. On local_test branch:
  • $git svn fetch
  • $git add filename
  • $git commit -m "Descriptive Message"
  • $git stash (temporarily stores other changes)
  • $git svn dcommit (moves up to test)
2. On local4.0-ND-dev branch:
  • First, switch to local4.0-ND-dev branch: $git checkout local4.0-ND-dev
  • $git checkout test filename filename ...
  • $git commit -m "Descriptive Message"
  • $git svn dcommit (moves up to 4.0-ND-dev)
  • Go back to local_test branch: $git checkout local_test
  • Apply the stashed changes from step 1: $git stash apply
3. Deploy to i2u2-dev server from SVN branch 4.0-ND-dev: 4. On local4.0-ND-prod branch:
  • You should be on local_test branch now. Stash your changes: $git stash
  • Switch to local4.0-ND-prod branch: $git checkout local4.0-ND-prod
  • $git checkout test filename filename ...
  • $git commit -m "Descriptive Message"
  • $git svn dcommit (moves up to 4.0-ND-prod)
  • Go back to local_test branch: $git checkout local_test
  • Apply the stashed changes from step 1: $git stash apply
5. Deploy to i2u2-prod server from SVN branch 4.0-ND-prod in the middle of the night Friday or Saturday (send e-mail message to cre-labusers@fnal.gov during the day):

Delete, create local branch:

Suppose you want to delete and recreate local_test (based on test):

1. Get on another local branch, perhaps local4.0-ND-dev.

2. Delete: $git branch -d local_test

3. To create local_test and move to it:
  • $git checkout -b local_test test
4. Alternatively, execute following 2 steps to create local_test branch and move to it:
  • $git branch local_test test (create local_test)
  • $git checkout local_test (move to local-test)
Topic revision: r8 - 2019-05-22, AdminUser
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback