A cool way to hide your files in a git folder

A cool way to hide your files in a git folder

ยท

2 min read

As funny is it sounds, you can most definitely hide your files in a git folder...

Although this in not an ideal way of hiding files with git (and is not recommended for hiding sensitive documents), it is also a cool way of keep others from seeing your files, or knowing the exist.

Before doing this, you should be sure you have git bash installed.

To begin, open your terminal/command prompt and navigate to the directory you want to work on.

git init

Make sure you are in the right directory

git branch <new name>

Now you have to switch to the new branch

git checkout <branch name>

You can now add the files you want to this directory like you normally would

Make git aware of your files and track the changes

git add .

At this point you will now have to commit(save) the files to git with a message

git commit -m <message>

you can now go back to the old branch that does not have your files

git checkout <branch name | master>

To view your files, switch to the branch that contains the files with

git checkout <branch name>

To learn more about git and git bash commands checkout sites

Feel free to do more. HAPPY CODING