view raw
Simon Simon - 8 months ago 49
Git Question

TortoiseGit how to edit or remove some files locally without affecting the online repository

I basically clone a Git repository locally with TortoiseGit and which contains for exemple 2 files:
- header.php
- index.php

I would like to remove or edit header.php and also edit index.php, but when I commit & push I want only the changes on index.php update the online repository (which will contain the unchanged header.php and the new index.php modified)

and I do not want to change .gitignore ....

  1. Right click in your repository and click Git commit -> "master".

Step 1

  1. Uncheck header.php in the Changes made area. Enter a commit message and click OK.

Step 2

  1. On the progress dialog that pops up, click Push... to push your changes to the remote repository.

Step 3

  1. On the push dialog that pops up, click OK.

enter image description here

Your changes to index.php will now be pushed to the remote repository, and your changes to header.php will still be present on disk.