Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»GIT»How To Add a Git Remote Repository

    How To Add a Git Remote Repository

    By RahulNovember 4, 20213 Mins Read

    Every time you clone a Git repository, you are actually downloading your project locally. This means that you will have a local copy of the Git repository tied to your project. Local copy that was created this way will be automatically connected to the remote repo. But what if you created a local copy first? In that case, you will have to add a Git remote repository. Read on and learn how to do that.

    Advertisement

    How to Add Git Remote

    You will notice word origin In an example of the syntax that you see below. Origin is not a flag nor does it have to be called “origin” in the first place. That is just the term to name your remote connection. You can name your remote connection however you want, but “origin” is a commonly agreed term when it comes to repository naming.

    Let’s see how we can add a Git remote repository. You’ll need two things. Name for your remote and URL of the remote repository. URL will be generated after you create a remote repository on GitHub.

    In order to add the remote repo, use the syntax below:

    git remote add origin https://github.com/tecrahul/helloworld.git 
    

    Please take note that “origin” can be named to whatever you prefer and the URL that we used is just an example. You will have to add the URL of your own repository.

    Everyone who works in the IT industry wants to check if something that was done actually works. You’ll probably want to do the same after you add a Git remote repository. Luckily, this can be done quickly and efficiently. Just run the following:

    git remote -v 
    

    The output of that should look like the one below.

    Output
    origin https://github.com/tecrahul/helloworld.git (fetch) origin https://github.com/tecrahul/helloworld.git (push)
    Example: Git Add Remote Origin
    Example: Git Add Remote Origin

    This means that everything is good. Always run this just to be sure.

    How to Add Remote with Tower Git Client

    If your machine is running on Mac or Windows operating system, there is a high chance that you are using Tower Git. Since Tower Git has a GUI through which repositories are being manipulated there is a simple box in which you need to enter necessary info. An example of it can be found below.

    Tower: Git Add Remote Origin
    Tower: Git Add Remote Origin

    And basically, that’s all there is to it. Hopefully, you’ll find this article useful in your future interactions with Git.

    git origin
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Git Change Remote URL: How to

    Git Change Remote URL in Local Repository

    Git Change Remote URL to SSH (from HTTPS)

    How to Create Branch in Git Repository

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Split Command in Linux With Examples (Split Large Files)
    • Test Your Internet Speed from the Linux Terminal
    • 11 Practical Example of cat Command in Linux
    • sleep Command in Linux with Examples
    • 20 Basic Linux Commands for the Beginners (Recommended)
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.