WJA
WJA

Reputation: 7004

How do you prevent a single file to be pushed on git commit

I use the following line of code in the terminal to push my files to github:

Git init
Git add -A
Git commit -m "name"
Git push origin master

How do I prevent a file, lets say

hello.html

to be pushed/updated?

Upvotes: 0

Views: 216

Answers (1)

houtanb
houtanb

Reputation: 4100

Create a .gitignore file in the repository that contains the relative path to the file. I.e.:

/path/to/hello.html

See the manual page for more information.

Upvotes: 1

Related Questions