Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

create-branch 1.0 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
  1. #!/usr/bin/env bash
  2. # [start-readme]
  3. #
  4. # This script is run on a writer's machine to create an Early Access branch that matches the current docs-internal branch.
  5. #
  6. # [end-readme]
  7. set -e
  8. # Get current branch name
  9. currentBranch=$(git rev-parse --abbrev-ref HEAD)
  10. if [ $currentBranch == "main" ]; then
  11. echo "You cannot run this script on the 'main' branch. Checkout a new branch first."
  12. exit 0
  13. fi
  14. # Go up a directory
  15. pushd .. > /dev/null
  16. if [ ! -d "docs-early-access" ]; then
  17. echo "A 'docs-early-access' directory does not exist! Run script/early-access/clone-locally first."
  18. popd > /dev/null
  19. exit 0
  20. fi
  21. # Navigate to docs-early-access
  22. cd docs-early-access
  23. # Check out main and update
  24. git checkout main
  25. git pull origin main
  26. # Create a branch with the current docs-internal branch name
  27. git checkout -b $currentBranch
  28. # Go back to the previous working directory
  29. popd > /dev/null
  30. echo -e "\nDone! Created a branch called ${currentBranch}. Remember to commit your work in ../docs-early-access when you're ready."
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...