dorawyy / git-merge-conflicts-test

This repo is for testing of git functionalities / different merging conflict scenarios, and CI tools usage
2 stars 4 forks source link

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

Open dorawyy opened 6 years ago

dorawyy commented 6 years ago

Fetching a remote - Github Help

Git Clone

When running git clone URL repo_name, the following occur:

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