The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Practical Git: Copy remote repos to local machines with git clone

Practical Git: Copy remote repos to local machines with git clone

1:06
When working on code, we need a way to stay in sync across multiple devices and potentially multilpe team members. We also may need to work on our code offline. To do these things, we can "clone" a remote repo (from a git repo hosting service like GitHub or Bitbucket); git cloning means we make a copy of an existing remote repository onto our local machine with the `git clone` command. This command also automatically sets up the remote repo and branch tracking. Once our repo is cloned to our machine, we can work on the code in this directory offline or with teammates at the same time and then when we need to sync up we can push our code back to the central “remote" repo; we can also clone this same repo onto multiple machines and “pull” updates from the central “remote" repo whenever we want. In this lesson, we walk through how to do this.
Watch this lesson now
Avatar
egghead.io

When working on code, we need a way to stay in sync across multiple devices and potentially multilpe team members. We also may need to work on our code offline. To do these things, we can "clone" a remote repo (from a git repo hosting service like GitHub or Bitbucket); git cloning means we make a copy of an existing remote repository onto our local machine with the git clone command. This command also automatically sets up the remote repo and branch tracking. Once our repo is cloned to our machine, we can work on the code in this directory offline or with teammates at the same time and then when we need to sync up we can push our code back to the central “remote" repo; we can also clone this same repo onto multiple machines and “pull” updates from the central “remote" repo whenever we want. In this lesson, we walk through how to do this.

Avatar
Oleg

Thanks for great lessons!
How to upgrade the terminal to show not folder only, but also the branch name [master]?

In reply to egghead.io
Avatar
Trevor

Thanks Oleg! You can customize your terminal prompt depending on which shell you use. If you google "how to add git branch to {your shell} prompt" that should give you some results. For me, I use bash and the GitHub git bash scripts, so here is an example: https://coderwall.com/p/fasnya/add-git-branch-name-to-bash-prompt

In reply to Oleg
Avatar
Oleg

Thanks Trevor! It was helpful for me.

In reply to Trevor
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?