Can't switch branches - “Error: Untracked working tree files…” should I do git add?
I have this on my .gitignore file:
1) I have checkout to master branch and then, checkout again, back to dev branch.
2) Once I got back to dev branch, I lost all /nbproject/ files and all /app/config/localdev.php as well !!! And perhaps the others, but since they are autogenerated by php framework uppon runtime, I can't really tell!
3) I then switch back to the master branch and I got those files there.
4) I've copy those files somewhere else, and I've switched to dev branch again.
5) I've place those missing files back inside /nbproject/ folder.
Now, if I try to switch to the Master branch, I'm getting this:
Error: The following untracked working tree files would be overwritten by checkout:
Please move or remove them before you can switch branches.
I'm aware that I should perhaps do a
git add . to move those files on the repository, what I'm not getting is:
Why is git trowing this message IF I had nbproject/ ignored well before those git checkout commands being issued ?
The point is to ignore those files. Both on master and dev. My question is: how can I fix this in order to:
a) First: get those files (the ones on gitignore) back to dev ?
b) Second: make steps to avoid this conflict again.
I have merge two branches. Now when i try to do 'git add .' One folder simply is ignored by the command. So then I run 'git status' this is displayed in red - 'modified: admin'. $ git status # On bra
I need to restore all files in my local machine to earlier revision and keep the untracked files as they are. I found this Rollback File to much earlier version and did first git reset <hash> M
Is it possible to configure git to print Untracked files first when doing git status? Currently, the printout when doing git status is something like stated below. Note: I do not want to use the ignor
I am looking at the man page for git ls-tree . It has an option for path. I have a directory called db and in that directory I have a few .rb files. Then why my command is failing git ls-tree db/*.rb
Is there a way to quickly detect if there are any untracked files? I can list all of the untracked files with git ls-files --other --directory --exclude-standard But this is slow if there are many u
I am attempting to clone a git repository. The clone fails with the following message: Untracked working tree file ... would be overwritten by merge. I have run git clean on all of the branches; non
How can I show the files git checkout adds/modifies/deletes in my working directory when I switch branches?
How do you clean only the workspace files from a git checkout? I have two branches with: a) files common to both b) files unique in each branch c) untracked files. I need to get rid of the b) files
This question already has an answer here: How do I add an empty directory to a Git repository? 21 answers git status command doesn't show new untracked directories and I can't git add them.. Ho
Is there anyone ever come across with this issue as follows...? When u add files to your project, and the Xcode git will indicate a ? as the badge. So, according to what I know about the meaning of
I have an upstream repository with some changes. I have local changes I want to rebase onto the upstream changes. I want to know what files I've changed locally have also changed upstream so I can che
What exactly is the difference? My goal is to completely restore the working tree to the state when it says no changes - no modifications or deletions, no new untracked files, nothing. I don't care
Is it possible to skip the staging area and (also) commit untracked, new files to git? http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository Providing the -a option to the git com
I am using git for my code. In my local repo i have a deleted a large folder and committed(git push) to repo, and after that i logged in to server and done git pull, but i got the below message .....
Suppose I have a chain of local git branches, like this: master branch1 branch2 | | | o----o----o----A----B----C----D I pull in an upstream change onto the master branch: branch1 branch2 | | A----B
# Untracked files: # (use git add <file>... to include in what will be committed) # # \n\n # .gitignore # public_html/_tinymce/jscripts/tiny_mce/0c50971a0f1f60d2408f9bd7eed5a979.gz It doesn
I tried to run brew update and I get an error about my local changes would be lost if I merged. I tried committing my local changes (don't remember making any, but it's been awhile), and that made thi
I have a plain copy backup of a .git directory. I don't have the actual files outside of the .git directory in the backup (git status shows that all files would be deleted on commit), only the actual
Possible Duplicate: How do I enter an exclamation point into a git commit message from the command line? I'm new to git, and I did this command: git commit -m First Commit! this throws an error
When I do git pull origin master, it does not seem to update the files in the folder of the git repository.
Is there any way to run scripts that includes switch statement with Perl 5.14? I have many scripts that use switch statement, I do not want to run them on other perl's version. What should I do?
Whenever I commit, I worry that I may have missed out a dependency and I'm looking for the simplest way to test my git tree in isolation to ensure whatever is in the git index (staged) will in fact
I have several .screen files inside /xxx/documentation and its subdirectories that are already tracked by Git. After modifying many of these screen files, I run git add documentation/\\*.screen—as ind
I want to add and commit a file in git without changing my current working directory. Is this possible? > pwd /tmp > git --git-dir=/tmp/git_test/.git init Initialized empty Git repository in /tm
I have two branches. I changed some files while on one branch but did not add or commit them. The changes are in my working folder only. The changes are on tracked files but not added or committed, th
I have a problem when I try to checkout to a branch. Im getting the error: Please, commit your changes or stash them before you can switch branches. error: The following untracked working tree files w
I am working on a svn project with two branches, lets call them trunk branches/foo My idea is to clone the whole svn repository (telling git which folder are trunk, tags and branches), do the merge i
I'm working on a fairly large git repo with a couple of thousand (remote) branches. I am used to using auto-completion (using [TAB]) in the console (Git Bash in that case), so I unconsciously do that
Suppose I have a directory with a bunch of files and other directories in git. If I do git init . git add . I will be adding everything including the directories to my git repository. However, if I
Every once in a while while I'm developing, I start to accumulate untracked working tree files and all I'm doing is git pull most of the time. Still, every once in a while I can't do a pull because
I have a repository where I created a new branch test and added a few files, made a few modifications. However, I see that when I switch back to the master branch the files I created in test are
I'm adding a new project to a new Git repository. I did git init, and when I do git add . it says : fatal: Not a git repository: MyProject-iOS/Frameworks/AFNetworking.git/../../../.git/modules/MyProj
I created a repo directly on GitHub using by browser, than using git bash cloned the repo to my machine, I was able to do a test commit with bash using the readme file. I keep getting fatal: This oper
Guys, even after using git add . I still have untracked files that I can't commit. There was another question with the same problem, but in that case it was related to case-sensitive folder. I didn'
How can I list any local branches that appear (as per .git/config) to be tracking remote branches that no longer exist? Remote branches are on GitHub in this case but I suspect their location has no r
These are a couple of question, should Spring Roo through reverse engineering adding FetchType.LAZY for Set fields in .aj files or should I do it manually? If FetchType.LAZY is not present at .aj file
I'm using git status -u to show untracked files. And on the terminal, I see plenty untracked files that I need to be untracked such as unit tests, personal documentation, etc. I have put them in .giti
Summary I have a problem where 160 (out of 3 605) image files show up as being untracked by Git, but I know that these files are, in fact, tracked. When cloning the repository anew, these files are
I've looked at about 10 answers to what seem to be a similar issue but I don't understand the answers in those threads sorry. Tower states that my working directory is clean in two out of three branch
I have constructed a tree that contains a couple of files and only exists in the object database. I then added it to the index associated with a path, and committed: git hash-object -w --stdin ... abc
I have a project based in //Engineering/qwerty/baseline/servers/ApplicationServer/ and branch //Engineering/qwerty/branches/rtf/ How can I do one git repo with master => //Engineering/qwerty/baseli
I have project with many branches. I would like to work on these simultaneously without switching back and forth with git checkout. Is there any way I can do that besides copying whole repository some
I'm using the git flow tools and I've gotten myself in a bit of problem. My git branches have diverged. I've read master branch and 'origin/master' have diverged, how to 'undiverge' branches'? and hav
I am trying to connect two independent commit trees into one repository. Initially I have: A--B--C--D (master1) E--F--G--H (master2) \ I--J (somebranch) These tree have no common ancestor and are ind
How can I differentiate between two local branches in git ? How can I copy one local branch to another local branch ? In general how can I perform difference operation between two local branches on m
I'm getting a lot of untracked / modified files that are like this in my Rails app: db/sphinx/development/user_core.spa db/sphinx/development/user_core.spd db/sphinx/development/book_core.sph db/sphin
I have a .gitignore file in a directory (not root) .ascii but these files keep appearing as untracked when I was about to commit the changes. Untracked files: # (use git add <file>... to incl
My usual workflow when working with git, is something like this: create a local repository do some work in that repository, add/change files etc. decide that I want a central remote location for the
The Git repository I'm working on has two main branches alpha and beta, both similar and both being actively worked on. When I'm working on a feature, it needs to be committed into both branches. Desp