Let’s assume we have an existing project called ‘foo’ and we want to create a fork called ‘bar’.
First, create a new project on GitHub called ‘bar’.
Next, clone foo using the name ‘bar’:
$ git clone [email protected]:YOURNAME/foo.git bar
$ cd bar
Next, edit your Git config file and replace the origin URL with your new URL: