Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
In normal git flow in case you have to checkout a file you would use:
git checkout -- your_file_name

In case you want to checkout multiple files you give other file names in front of checkout --. Sometimes there are bunch of modified files that you want to checkout all of them at once, so you need to go to the root of the project and:
git checkout -- .

It will checkout all files in your project.

You can also use:
git reset --hard

It will reset your working directory and replace all changes (including the index).

#git #checkout #reset #hard
I usually use linux copy command cp to copy files from my project into a production environment project. I copied wrong files by accident from a different repo into production environment and messed up the repo. Some files got into modified state, many untracked
files added into the project.

To revert all the C**P and make a clean slate of your project again, you just need to do 2 things:

1- git checkout .

2- git clean -f


First command will revert all modified files into their previous state. Second one will remove all untracked files.

Happy copying :)

#git #revert #checkout #clean #git_clean
In order to checkout all files in a project in GIT:

git checkout -- .


#git #checkout