Pages

Saturday, June 12, 2021

Git : How to unversionned files ?

Sometimes, I commit files I don't want.This reminder explain how to remove theses files from GIT.

First, you can list files managed by your GIT repositories :

git ls-files => list des fichiers versionnés
git rm --cached .idea

Then, you have to delete unwanted files.In my case, I commited the .idea directory :

git rm -r --cached .idea
rm '.idea/$CACHE_FILE$'
rm '.idea/.gitignore'
rm '.idea/misc.xml'
rm '.idea/modules.xml'
rm '.idea/php.xml'
rm '.idea/vcs.xml'
rm '.idea/yuzu.iml'

If you check the status, you are going to see delete files :

git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)
        deleted:    .idea/$CACHE_FILE$
        deleted:    .idea/.gitignore
        deleted:    .idea/misc.xml
        deleted:    .idea/modules.xml
        deleted:    .idea/php.xml
        deleted:    .idea/vcs.xml
        deleted:    .idea/yuzu.iml

You only have to execute the commit command : git commit -m "Delete unwanted files"

The last step is to add the unwanted files or directory in the .gitignore file (.idea in my case) :

vi .gitignore 
.idea


GIT : version 2.17.0.windows.1

Thursday, June 10, 2021

Debian 10 : enable unattended upgrade

 This article is a simple reminder to enable unattended upgrade feature quickly under Debian 10.

Configuration

apt install unattended-upgrades
vi /etc/apt/apt.conf.d/50unattended-upgrades

You have to activate update automatically. In that case, we made package update 
and security update :

"origin=Debian,codename=${distro_codename},label=Debian";
"origin=Debian,codename=${distro_codename},label=Debian-Security";
Unattended-Upgrade::Mail mail@toto.fr;
dpkg-reconfigure --priority=low unattended-upgrades

systemctl status unattended-upgrades.service

Note : A mail is sent every week if update occurs.

More details : https://linuxhint.com/managing_debian_unattended_upgrades/

Frequency

cat /etc/apt/apt.conf.d/20auto-upgrades

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

You can check which packages are updated :

tail /var/log/dpkg.log


Set frequency

I didn't configure this feature but you could find more information :

https://unix.stackexchange.com/questions/342663/how-is-unattended-upgrades-started-and-how-can-i-modify-its-schedule

Tuesday, June 8, 2021

Git : How to recover your files after an improper handling ?

This small reminder permits to recover your project files very quickly without making an git clone.
For example, I use it if I delete files.

First stash your modifications :

git stash save "Bad manip"

git stash list

stash@{0}: On master: Bad manip
stash@{1}: On master: Menu publication

Then, you can delete your bad stash :

git stash drop stash@{0}

Dropped stash@{0} (838f86a5ea1ebb875f34adb1dd6fda9f1b6c89c3)

git stash list

stash@{0}: On master: Menu publication

That's all !

Feel free to comment.


GIT : version 2.17.0.windows.1

PlayConsole : suppression des warnings lors de la publication (minify, symbole de debogage...)

Lors de la publication des versions dans la PlayConsole, j'avais 2 warnings pour indiquer qu'il était possible de réduire et d'o...