Search code examples
githubrepositorygit-commitgit-fork

When to commit your changes?


Suppose I fork a repository and create a branch from the forked master repository. Now while I am working on the file on Github itself without cloning it to the local disk other people commit to the master repository so like now I see this message on the top -

This branch is 1 commits ahead, 15 commits behind pandas-dev:master.

Now after doing my stuff should I directly raise a pull request ? or first do something so that it is not 18 commits behind.


Solution

  • A good practice would be to always pull the latest changes first from your upstream ,which is master in your case .

    This will make sure that both branches are in Sync and point to the same HEAD. then when you create a PR, it will only show to the changes to files you have modified.