Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It sounds like you are trying to track a file (e.g. <code>index.php</code>), add it to a remote repository, then stop watching tracking it, while keeping the file in the remote (i.e. keep <code>index.php</code> unchanged on the remote repo while changing it locally).</p> <p>From what I understand, git cannot do this. You can either track a file, or not. If you track a file, it exists in the remote repo, and changes when you commit changes to it. If you don't track a file, it doesn't exist in the remote repo.</p> <p>Because it is not possible to do exactly what you want with git, there are potentially other solutions, depending on your exact situation. For example, why do you not want <code>index.php</code> to change on remote when you change it locally? Are there user-specific settings in the file? If this is the case, you can do:</p> <pre><code>cp index.php index_template.php git rm --cached index.php </code></pre> <p>Now edit index_template.php to be as you want it to appear on the remote repo. Add something to your README to tell the people using your repository that once they clone it, they must copy index_template.php to index.php and edit it to suit their needs.</p> <pre><code>git add index_template.php git add README git commit -m 'added template index.php file' git push </code></pre> <p>When someone clones your repo, they must create their own <code>index.php</code>. You've made it easy for them: simply copy <code>index_template.php</code> to <code>index.php</code> and revise it with computer-specific settings.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload