Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[concept] CLONE, FETCH, MERGE, PULL #68

Open
dorawyy opened this issue Nov 11, 2017 · 0 comments
Open

[concept] CLONE, FETCH, MERGE, PULL #68

dorawyy opened this issue Nov 11, 2017 · 0 comments
Labels

Comments

@dorawyy
Copy link
Owner

dorawyy commented Nov 11, 2017

Fetching a remote - Github Help

Git Clone

When running git clone URL repo_name, the following occur:

  • A new folder called <repo_name> is created locally
  • It is initialized to a Git repo
  • A remote named origin is created, pointing to the URL that we cloned from
  • All of the repo's files and commits are downloaded locally
  • The default branch (usually called master, however, the owner of the repo can change it), is checked out

For every branch foo in the remote repo, a corresponding remote-tracking branch refs/remotes/origin/foo is created in the local repo, which is usually abbreviated as origin/foo

Git Fetch

When git fetch, retrieve new work done by other people. Fetching from a repo grabs all the new remote-tracking branches and tags without merging those changes into local branches.

If the remote repo is configured, then with this command, we can grab all new info from the upstream repo:

git fetch upstream_repo_name

Git Merge

Merging combines local changes with changes made by others.

git merge branch_to_merge

Git Pull

Is a shortcut to complete both git fetch and git merge:

git pull remote_repo branch
@dorawyy dorawyy changed the title [concept] clone, fetch, merge, pull [concept] CLONE, FETCH, MERGE, PULL Nov 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant