Basic Git 1

 

How to create a forked repository

  1. Log in to Github and create a repository with desired name.

  2. Move to the directory you want and clone the reposity you want to fork.

     git clone --bare https://github.com/GITHUBID/REPONAME.git
    
  3. Mirror this to your repo.

     cd REPONAME.git
     git push --mirror https://github.com/YOURGITHUBID/YOURREPO
    
  4. Now you can delete the REPONAME.git created in step 2.

  5. Clone your repo on your local system.

     cd ../
     git clone https://github.com/YOURGITHUBID/YOURREPO
    
  6. Now you can use it like this

     git push origin master # push changes made
    
     git remote -v # check all the remote branches
    
     git remote show origin
    
     git remote get-url
    
     git branch -a 
    
     git checkout <branch_name>