Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
themeRDark
$ git branch -m master main
$ git push -u origin main
$ cd to bare repo in AFS
$ git symbolic-ref HEAD refs/heads/main
$ cd back to local repo
$ git push origin -d master

...

Replace <organization> and <repo> with the proper names in the recipe below. You will need to push every branch that you need. Below is just an example for code created at SLAC, but customized code from the community will have different branches than this example. Don't forget to add --tags to the push command. For code created at SLAC, use the -u argument for the pre-release branch. This will make it the default branch.

Code Block
languagebash
themeRDark
# go to the bare repo on AFS
$ cd /afs/slac.stanford.edu/g/cd/swe/git/repos/.../<repo>.git

# Add a new remote called github-origin 
$ git remote add github-origin git@github.com:<organization>/<repo>.git

# Push all refs and tags to that repository
$ git push github-origin main --tagsall
$ git push -u github-origin pre-release --tags

7. Archive & Decommission Repository in AFS

...

Code Block
# Clone the scripts
$ git clone git@github.com:slac-epics/migration-scripts.git

$ cd migration-scripts

# Give it the location of the BSA repository on AFS and on GitHub, and run.
$ ./decommission-repo.sh -r $GIT_SITE_TOP/package/timing/bsa.git -u https://github.com/slaclab/bsa.git

...

Code Block
languagebash
themeRDark
$ eco -m eco_modulelist

Edit modulelist.txt on your local copy and commit your changes.

...

Code Block
languagebash
themeRDark
# Commit our changes to the module list
$ git add modulelist.txt
$ git commit -m "migrate things to GitHub"
$ git push origin master

# Go to the release area and pull in the latest changes
$ cd /afs/slac/g/lcls/tools/eco_modulelist
$ git pull

Now test with eco to see if the clone is made from GitHub and if the repository was correctly set in modulelist.txt.

...