How can I find the location of origin/master in git, and how do I change it?

前端 未结 13 527
悲哀的现实
悲哀的现实 2020-12-02 03:33

I\'m a Git newbie. I recently moved a Rails project from Subversion to Git. I followed the tutorial here: http://www.simplisticcomplexity.com/2008/03/05/cleanly-migrate-yo

13条回答
  •  旧巷少年郎
    2020-12-02 04:12

    I am a git newbie as well. I had the same problem with 'your branch is ahead of origin/master by N commits' messages. Doing the suggested 'git diff origin/master' did show some diffs that I did not care to keep. So ...

    Since my git clone was for hosting, and I wanted an exact copy of the master repo, and did not care to keep any local changes, I decided to save off my entire repo, and create a new one:

    (on the hosting machine)

    mv myrepo myrepo
    git clone USER@MASTER_HOST:/REPO_DIR myrepo
    

    For expediency, I used to make changes to the clone on my hosting machine. No more. I will make those changes to the master, git commit there, and do a git pull. Hopefully, this should keep my git clone on the hosting machine in complete sync.

    /Nara

提交回复
热议问题