M
M
mindgrow2019-07-29 13:52:51
git
mindgrow, 2019-07-29 13:52:51

How to remove redundant files from a commit?

Good afternoon!
The commit got files that were not supposed to get there and the commit was shipped to the repository in a separate branch. At the end of the task, one of all commits will be made through squash and transferred to the main branch. How do I remove redundant files from my branch so they don't get pushed back to main when I do a cherry pick?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
user49981, 2019-07-29
@user49981

git rm -r --cached file1 file2 file3
git commit -m 'remove files from git'

R
res2001, 2019-07-29
@res2001

See here .
"Breaking a commit" section.
It does not describe your task, but the solution is quite suitable for you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question