Forking on GitHub

Problem

I create my own bb code translation to allow external parties to update my site and limit their possibility of wrong doing. So basically code change a tag like [b]bold[/b] to <b>bold</b>... to render a text in bold.

This ensure that I can guarantee that nobody can create titles with his/her own formatting making the site more consistent on a UI.

After a while, I realize tha the BBcode project was doing in several places a better job.

What I did ...

Cloned the Git up repo

  • Cloned the repo
  • Created a virtualenv environment
  • Created the branch
  • Checked out the branch
git clone git@github.com:dcwatson/bbcode.git
virtualenv -p python3 ../venv
git branch -c Convert_Entities
git branch -a 
  Convert_Entities
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/gh-pages
  remotes/origin/master

git co Convert_Entities  

Code change

This is minimal : Coded the conversion of non ascii characters into their corresponding HTML-entities.

I thought then to create a Pull request but no possibility to push my change to the original repository.

Fail ! ! !

Forking and pushing to my own repo

Forking is rather simple on GitHub but then you need to connect your repo to the forked repo

git remote set-url origin <url_of_new_repo>

in our case :

git remote set-url origin git@github.com:A3-SYSTEM/bbcode-with-entities.git

References

  1. https://forum.freecodecamp.org/t/push-a-new-local-branch-to-a-remote-git-repository-and-track-it-too/13222
  2. https://stackoverflow.com/questions/5749246/how-do-i-change-which-github-project-i-forked-from