Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move tracked files to untracked with git

Tags:

git

github

So I was searching around about this and didn't find a exact answer, should be a simple command I think for a simple process.

So basically I want:

How to move them down to untracked so I can easily get them back when I want to push them, how to in a fast way?

like image 412
Tatu Bogdan Avatar asked Feb 15 '17 08:02

Tatu Bogdan


People also ask

Will git push untracked files?

Both the git stash save and push commands work with the --include-untracked and -all switches.

What does git untracked mean?

Untracked files are files that have been created within your repo's working directory but have not yet been added to the repository's tracking index using the git add command.


1 Answers

There are some possibilities. You can make a new branch checkout the new branch and commit the changes to the new branch and work on that branch.

Your changes will exist if you change the branch only if you have a conflict in that new branch you get an error but if you create a new you have no problems.

If you want to revert your change then you can find the answer in your image.

git checkout filename

with

git rm --cached filename 

you can remove that file from your repo but keep it on you local disk.

like image 105
René Höhle Avatar answered Oct 18 '22 14:10

René Höhle