You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
dorawyy
changed the title
[concept] clone, fetch, merge, pull
[concept] CLONE, FETCH, MERGE, PULL
Nov 11, 2017
Fetching a remote - Github Help
Git Clone
When running
git clone URL repo_name
, the following occur:<repo_name>
is created locallyorigin
is created, pointing to the URL that we cloned frommaster
, however, the owner of the repo can change it), is checked outFor every branch
foo
in the remote repo, a corresponding remote-tracking branchrefs/remotes/origin/foo
is created in the local repo, which is usually abbreviated asorigin/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 Merge
Merging combines local changes with changes made by others.
Git Pull
Is a shortcut to complete both
git fetch
andgit merge
:The text was updated successfully, but these errors were encountered: