Given the workflow we just walked through, we can identify 3 separate environments or phases of working locally: If we were to try to push this up to GitHub somewhere, nothing would appear. Notice if you do a git log, you still don’t have any commits to you local repo, so your local repo is still considered empty right now. It holds onto any file changes that you are considering committing to your local git repo. This phase right here is called your staging area. If we follow the instructions here and we do a git add, we see that file is now highlighted in green instead of red, and git is now aware of it as something that can be committed. This means that git can tell there’s a file in your current working directory, but it’s not keeping an eye on it yet. You should see that you have a single untracked file. So if you were to add files to this directory, we would be able to track any future changes to them.Īdd a file to your directory, then run a git status. We have no remote repository associated with this local git repository just yet, it simply lives on our machine and gives us all the version control features of git. Now run git init – you’ve just created a local git repository! In your terminal, create a new directory and cd into it. Local repos live on our machines and allow us the full benefit of git’s version control. our remote repo - which lives on GitHub, where anyone can view our files and clone or fork their own local copy.We cd into a project directory and edit our code files, we run git add and git commit on them, etc. our local repo - which lives on our machine, where we make our changes and do our development.When we’re working with git and GitHub, we usually have 2 repos that represent the same codebase: link remotes to your local repositories.choose the appropriate method for copying a repo.articulate the difference between forking and cloning.articulate the difference between your remote and local repos.Local Repo A repository on your machine that allows you to version control a directoryīy the end of this lesson, you will be able to:.Remote Repo A repository on the web that allows others to view and contribute to your code.Forking Creating your own copy of somebody else’s repo.Cloning Copying a remote repo to your local machine. ![]() Git A distributed version control system.Git Review - remotes/locals and forking/cloning
0 Comments
Leave a Reply. |