how to properly pull from main repo, update local files, then push changes to own repo?

10,936

Solution 1

When you pull changes it pulls the changes to your local repo. hg update updates the working copy (the files you edit, not the repo, the changes are in already in your repo since you pulled them).

So once you pulled the changes (to your local repo) and updated your working copy (from your local repo) there was nothing more to do.

You normally don't need to push changes to local repo (except pushing from other repos). You push between repos.

If you edit something in your working copy you can commit it.

Generally you:

  1. pull changes using hg pull ...
  2. update local repo using hg update
  3. change something in working copy
  4. commit changes to local repo using hg commit ...
  5. push changes to some other repo using hg push ...

Also note that push and pull are symmetric operations.

Solution 2

Follow up to soulcheck

  • Your pull-push operations are repo-repo side
  • You update Working Copy (files, which you can see) from local repo
  • You commit own changes into local repo

You can faster get remote data in your Working copy using hg fetch or hg pull -u instead of plain hg pull

Share:
10,936
iCodeLikeImDrunk
Author by

iCodeLikeImDrunk

Updated on June 04, 2022

Comments

  • iCodeLikeImDrunk
    iCodeLikeImDrunk about 2 years

    Yes, I've googled and I could not find the answer to this problem.

    First thing, my team and I are noobs with hg, bitbucket, etc. Our first task was to add our names on the read.txt, each member do it on their own machine. Now all of us had added the names and the main repo has been updated with all of our names.

    My own repo is a fork from the main repo. It only had some of the names because I was the first ones to add the name. When I pull from the main repo, it asked that I use "hg update", this updates my local files with all the names.

    Here's my question:

    My local files are the same as the main repo, but my forked repo does not. I tried to push the updated changes to my repo but it says "no changes found".

    What is the proper way to pull changes from the main repo and then push it to my own repo?