How to create an empty git repositoty in linux?



  • Link: https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository
    Man: https://lightnetics.nodebb.com/topic/921/git-the-stupid-content-tracker

    To create a git repository, there are couple of ways your can create an empty repository or one you where you already have files. There also other repositories called bare repositories, which will be explained in another article.

    A good practice is to make a top level folder called something like "git", but it's not required.

    Here we create repository from scratch, to tell git we want to track this folder.

    $ mkdir mygitrepo
    $ cd mygitrepo
    $ git init
    Initialized empty Git repository in /home/trainer/git/mygitrepo/.git/
    $ ls -a
    .  ..  .git
    

    A command that you'll be using a lot to constantly check the status of things in git is:

    $ git status
    On branch master
    
    Initial commit
    
    nothing to commit (create/copy files and use "git add" to track)
    

    Now you can start creating your files and folders for your project.

    Git does not have to be used with github or any other web based repositories, but web based git repositories hold many popular software projects, open source or otherwise, which developers use to work on and contribute to, they do this by forking (creating a copy of) of the original project into their own web based git account (this could be github, bitbucket, gitlab and so on), depending on where the project is kept, then they create local copy of the project so they can work on their local laptop or desktop in their own development environment.

    Also see: How do i use git to clone a repository? http://bit.ly/2oUrTNE


Log in to reply
 

© Lightnetics 2024