Creating Lanes from Branches

To improve your development workflow and ensure your Git branches and Bit lanes are in sync, add a post-checkout hook to your local repository. This hook automatically creates a lane in Bit for every new branch you create locally. When you switch between branches, the hook also switches your workspace to the corresponding lane.

  1. Download these files.
  2. Place the create-lane.js file anywhere in your local repository.
  3. Place the post-checkout file in your local repository's .git/hooks directory. Update the path in this file to match the location of the create-lane.js file.
  4. Make sure the post-checkout file is executable. If it's not, run chmod +x .git/hooks/post-checkout.

Export your lane before 'git push'

To ensure that your lane is exported with recent updates, before pushing changes to the remote, add a pre-push hook to your local repository.

  1. Download these files
  2. Place the export-lane.js file anywhere in your local repository.
  3. Place the pre-push file in your local repository's .git/hooks directory. Update the path in this file to match the location of the export-lane.js file.
  4. Make sure the pre-push file is executable. If it's not, run chmod +x .git/hooks/pre-push.