Reputation: 8705
I am new to git and left to work with live server.
After few successful git pull
actions, on the latest one I got this error:
error: Untracked working tree file
'www/files/userphotos/styles/100x100/noavatar.png' would be overwritten by merge. Aborting
I tried git stash
, but nothing happen - the error on git pull is still there.
How can I perform git pull
and not mess anything on the server?
Upvotes: 0
Views: 2052
Reputation: 141946
You need to do git add before the git stash
# Add the file to the staging area
git add . -A (alias for git add . && git add -u .)
# stash changes
git stash
# opull server updates
git pull
Use git worktree
git worktree
allow you to work on different branches at the same time,
Here you can see that one folder is "dirty" while the second one isn't
They both using the same (single) repository
If you use rebase later on:
git rebase [--no]-autostash
as well.Upvotes: 2