I've created a local git repo, which contains 2 branches i.e master
and stable
Using master
as a development branch and it has gone 4-5 commits ahead of stable
and it also contains some unstaged edits.
The problem is that a bug has come in against stable
, so I've stashed my unstaged edits on master
and performed a checkout against stable
.
Now I need a file from master
, specifically travis.yml
, so I can add it to stable
for when I commit the bug fix.
Is there a clean way to do this so that when I merge stable
back into master
there are no conflicts with the existing travis.yml
?
This is what I've tried but no luck ..
rob@laptop:~/git/project$ git status
On branch stable
Your branch is up-to-date with 'origin/stable'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: config/user.properties
no changes added to commit (use "git add" and/or "git commit -a")
rob@laptop:~/git/project$ git checkout master/86e6e26acf .travis.yml
error: pathspec 'master/86e6e26acf' did not match any file(s) known to git.
error: pathspec '.travis.yml' did not match any file(s) known to git.