Synchronizing a local Git repository with a remote one

后端 未结 10 552
独厮守ぢ
独厮守ぢ 2020-11-30 16:00

I want to synchronize my local repository with a remote one so that my local repository becomes a 100% copy of the remote one - meaning that if certain files differ in these

10条回答
  •  孤独总比滥情好
    2020-11-30 16:34

    (This info is from The Git User's Manual)

    I'm also learning, so this might not be exactly an answer to the question but it might help somebody:

    1. When a remote repository is initially cloned copies of all branches are stored in your local repository (view them with git branch -r)
    2. To update these copies and make them current (i.e. sync them with the remote branch) use git fetch. This will not effect any of you existing, custom created branches.
    3. To override your local branch checkout a fresh version of whatever branch you are working on (Assuming that you have already executed git add origin /path/to/repository) use git checkout origin/branch_name, this will override your locals changes on branch branch_name

提交回复
热议问题