Skip to main content
Post Closed as "Duplicate" by msanford, phd, CommunityBot
added 131 characters in body
Source Link

I have a server. My web project is hosted in GitHub. I made a cronjob in my server to pull changes from GitHub repository. But, as there is database user, password information, so I put fake user and password in GitHub repo pages. I make a script and put in the server that changes the database name and password of the file where use database user and password. The scripts run after each pulling.

But, problem is when there is local changes available git don't support pulling from remote.

I use git pull origin master that results

 * branch master -> FETCH_HEAD 5aef90a..f0ef960 master -> origin/master Updating 5aef90a..f0ef960 error: Your local changes to the following files would be overwritten by merge: README.md Please, commit your changes or stash them before you can merge. Aborting 

Now what can I do so that git ignore local changes?

Edit 1
suppose I have a file connection.php that have the fake password and user. I want to ignore that file changes.

I have a server. My web project is hosted in GitHub. I made a cronjob in my server to pull changes from GitHub repository. But, as there is database user, password information, so I put fake user and password in GitHub repo pages. I make a script and put in the server that changes the database name and password of the file where use database user and password. The scripts run after each pulling.

But, problem is when there is local changes available git don't support pulling from remote.

I use git pull origin master that results

 * branch master -> FETCH_HEAD 5aef90a..f0ef960 master -> origin/master Updating 5aef90a..f0ef960 error: Your local changes to the following files would be overwritten by merge: README.md Please, commit your changes or stash them before you can merge. Aborting 

Now what can I do so that git ignore local changes?

I have a server. My web project is hosted in GitHub. I made a cronjob in my server to pull changes from GitHub repository. But, as there is database user, password information, so I put fake user and password in GitHub repo pages. I make a script and put in the server that changes the database name and password of the file where use database user and password. The scripts run after each pulling.

But, problem is when there is local changes available git don't support pulling from remote.

I use git pull origin master that results

 * branch master -> FETCH_HEAD 5aef90a..f0ef960 master -> origin/master Updating 5aef90a..f0ef960 error: Your local changes to the following files would be overwritten by merge: README.md Please, commit your changes or stash them before you can merge. Aborting 

Now what can I do so that git ignore local changes?

Edit 1
suppose I have a file connection.php that have the fake password and user. I want to ignore that file changes.

added 7 characters in body
Source Link
Vy Do
  • 1
  • 70
  • 267
  • 397

I have a server. My web project is hosted in githubGitHub. I made a cronjob in my server to pull changes from github repoGitHub repository. But, as there is database user,password password information, so I put fake user and password in githubGitHub repo pages. I make a script and put in the server that changes the database name and password of the file where use database user and password. The scripts run after each pulling.

But, problem is when there is local changes available git don't support pulling from remote.

I use git pull origin master that results

 * branch master -> FETCH_HEAD 5aef90a..f0ef960 master -> origin/master Updating 5aef90a..f0ef960 error: Your local changes to the following files would be overwritten by merge: README.md Please, commit your changes or stash them before you can merge. Aborting 

Now what can I do so that git ignore local changes?

I have a server. My web project is hosted in github. I made a cronjob in my server to pull changes from github repo. But, as there is database user,password information, so I put fake user and password in github repo pages. I make a script and put in the server that changes the database name and password of the file where use database user and password. The scripts run after each pulling.

But, problem is when there is local changes available git don't support pulling from remote.

I use git pull origin master that results

 * branch master -> FETCH_HEAD 5aef90a..f0ef960 master -> origin/master Updating 5aef90a..f0ef960 error: Your local changes to the following files would be overwritten by merge: README.md Please, commit your changes or stash them before you can merge. Aborting 

Now what can I do so that git ignore local changes?

I have a server. My web project is hosted in GitHub. I made a cronjob in my server to pull changes from GitHub repository. But, as there is database user, password information, so I put fake user and password in GitHub repo pages. I make a script and put in the server that changes the database name and password of the file where use database user and password. The scripts run after each pulling.

But, problem is when there is local changes available git don't support pulling from remote.

I use git pull origin master that results

 * branch master -> FETCH_HEAD 5aef90a..f0ef960 master -> origin/master Updating 5aef90a..f0ef960 error: Your local changes to the following files would be overwritten by merge: README.md Please, commit your changes or stash them before you can merge. Aborting 

Now what can I do so that git ignore local changes?

Source Link

How to pull remote changes in local ignoring local changes in git?

I have a server. My web project is hosted in github. I made a cronjob in my server to pull changes from github repo. But, as there is database user,password information, so I put fake user and password in github repo pages. I make a script and put in the server that changes the database name and password of the file where use database user and password. The scripts run after each pulling.

But, problem is when there is local changes available git don't support pulling from remote.

I use git pull origin master that results

 * branch master -> FETCH_HEAD 5aef90a..f0ef960 master -> origin/master Updating 5aef90a..f0ef960 error: Your local changes to the following files would be overwritten by merge: README.md Please, commit your changes or stash them before you can merge. Aborting 

Now what can I do so that git ignore local changes?