Navigation Menu

Skip to content

While switching the branch , facing an error #21382

Answered by Wabri
shweta13agg asked this question in General
Discussion options

You must be logged in to vote

Hi @shweta13agg,

Welcome to the Github Community Forum!

The error shows you the file that prevent you from checkout, that file is in the dirty form in that branch so you need to change his form by move it to staged area or delete the changes made to that file.

To move to staged area you need to add that file and commit:

git add .gitconfig
git commit -m 'Update (.gitconfig)"

To delete changes made to that file you need checkout that file:

git checkout -- .gitconfig

The untracked files are the files that are not in the history yet. If you don’t want this files in the history you can add them to the .gitignore file, for example you don’t want the eclipse metadata you need to add the .eclipse

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants