If you have only one local branch and are tracking one remote branch, all you need to do is git pull And use git stash to save changes which are not yet committed.) Make sure that you really want this - otherwise better use a new branch, this saves your local commits. (But then you will really lose any local changes - both in working copy and local commits. ( git pull will incorporate all updates of the remote branch in your local one, which might do the same, or create a merge commit if you have local commits.) Then you check out the local branch corresponding to the remote branch you want to update to, and use git reset to switch it to the fetched remote branch. To avoid any conflicts with your working copy (which might have local changes), you first clean everything which is not versioned (using git clean). I think you want to update your local branch (or maybe all the local branches?) to the corresponding remote branch, and then check out the latest branch. This commit is usually the tip of one of your local branches. Your working copy has normally a commit checked out, called HEAD. branches named like remotes/origin/master or such.įetching new commits from the remote repository will not change anything about your local working copy. These are then in your repository as "remote tracking branches", e.g. When fetching from a repository, you will copy all or some of the branches there to your repository. You need to understand that a Git repository is not just a tree of directories and files, but also stores a history of those trees - which might contain branches and merges.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |