mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] dw_dev2022-10-19 04:08 pm

GitHub repository rename and updates

Hi all!

As of today, I've made a few fairly broad changes to the way our repositories are set up. You will need to likely make some changes to your development workflow. But! They should be simple.

First, the changes:

  1. The dw-free repository has been renamed to dreamwidth -- because,

  2. The dw-nonfree repository is no more, it has been merged into the dw-free under the path ext/dw-nonfree/.

  3. Finally, the master branch has been renamed to main.

These two changes mean that no more do we have to track and coordinate changes across two repositories, they can be done atomically in one place. Since we don't really support or test running Dreamwidth on its own (without the branding) this will also allow us to simplify development by ultimately collapsing the code, too.

To update your checkout of Dreamwidth, you will need to do two separate things. First, go to Github and to your existing dw-free repository, go to the settings and:

  1. Rename the repository to dreamwidth

  2. Go to branches and rename the master branch to main

Once that's done, you need to update your local checkout like this:

 cd $LJHOME

 # WARNING: Only do this if you have no code here that you care about!
 rm -rf ext/dw-nonfree

 # Update the repository root (for your "origin" remote, **set your username here**)
 git remote set-url origin git@github.com:YOUR_GITHUB_USERNAME/dreamwidth.git

 # Update the repository root (for your "upstream" remote, please change as needed)
 git remote set-url upstream git@github.com:dreamwidth/dreamwidth.git

 # Fetch only to get the new main branch
 git fetch

 # Switch over to it
 git checkout main

 # Get rid of local master
 git branch -d master

 # Redirect HEAD
 git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main


That's it; you should be good to go now. I'll work on updating the Dreamhack scripts shortly, but wanted to get these instructions out. Please let me know if you have any questions/comments/issues.

kareila: IT prepares you for a life of fighting with PCs nonstop. (sysadmin)

[personal profile] kareila 2022-10-19 01:05 pm (UTC)(link)
I would point out that for most people, "origin" is going to point to their own fork, not the main repository. For example, this is what I currently have configured:

origin git@github.com:kareila/dw-free.git
upstream https://github.com/dreamwidth/dw-free.git

So I will immediately edit my upstream, but I believe I will have to refork before updating my origin.
alierak: (Default)

[personal profile] alierak 2022-10-19 01:17 pm (UTC)(link)
Rather than refork, I was able to rename my dw-free fork to dreamwidth in the "General" settings area on github. There's also a place in the "Branches" settings to change the default branch to main, so I did that too.
kareila: Taking refuge from falling debris under a computer desk. (computercrash)

[personal profile] kareila 2022-10-20 02:46 am (UTC)(link)
At some point I started seeing this error message during git operations:

warning: ignoring broken ref refs/remotes/origin/HEAD

I was able to fix it by doing the following:

git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main