Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reinitialize Git Repo

Tags:

git

I have a git repository hosted on a server. We are 5 members in the team and all have cloned from this same repo. Since the start .log and .yml files are being tracked.

Is there a simple way to make Git not to track these files. We have tried --assume-unchanged but we were not able to get through.

Could anyone suggest step by step instructions to achieve above?

Thanks, Imran

like image 398
Saim Avatar asked Jul 20 '10 05:07

Saim


People also ask

What happens when you reinitialize a git repository?

This file acts as filesystem-agnostic Git symbolic link to the repository. If this is reinitialization, the repository will be moved to the specified path. Use the specified name for the initial branch in the newly created repository.

How do I reinitialize a git repository in Visual Studio code?

Initialize new repositoryOpen the command palette with the key combination of Ctrl + Shift + P . Filter with Git , then select Initialize repository .


1 Answers

You can create a file called ".gitignore" in the root of the repository with the following contents:

*.yml
*.log

To make git ignore changes to files matching the pattern. To remove your already existing copies of .yml files and .log files, you'd do this:

rm *.yml *.log
git rm *.yml *.log
git commit -m "removed .yml and .log files"

If you don't want to remove the .yml files (assuming they are configuration files of sort), you can add them to .gitignore, but still git-add a default one for the repository. If anyone were to change their .yml files, git would ignore the changes.

If you want everyone to have the same .gitignore file, add it to the repo as well. If you want everyone to be able to freely configure their .gitignore file for their own purposes, you can add ".gitignore" to the .gitignore file.

like image 151
jA_cOp Avatar answered Oct 25 '22 19:10

jA_cOp