From: Arup Rakshit <aruprakshit@rocketmail.com>
To: git@vger.kernel.org
Subject: Re: untracked file deleted from the master branch, when checked out to it from a local branch
Date: Wed, 21 May 2014 00:10:47 +0630 [thread overview]
Message-ID: <2654529.8c5AhJCJsq@linux-wzza.site> (raw)
In-Reply-To: <xmqqk39gz4tw.fsf@gitster.dls.corp.google.com>
On Tuesday, May 20, 2014 11:24:11 AM you wrote:
> Arup Rakshit <aruprakshit@rocketmail.com> writes:
>
> Untracked files and modifications to files in your working directory
> do not belong to your current branch. This is to allow you, after
> starting to work on one branch then realizing that the changes and
> additions you are making do not belong there, to switch to a more
> appropriate branch at that point without losing your work so far,
> taking these changes and additions with you to the branch you want
> to commit your changes to.
>
Now, It makes sense. I gave it another try and this time I walk from back to
front.
Now you can see, that I have created, a new file called *file.txt*, in the
*master branch*. Now I went to a new branch and made some changes there in the
newly created file. This time I didn't add it or commit too. I just came back
to *master branch*. Now if I do *ls*, can see the file is present in the
*master* branch.
arup@linux-wzza:~/Git_tutorial> ls
test.txt
arup@linux-wzza:~/Git_tutorial> echo "hello" > file.txt
arup@linux-wzza:~/Git_tutorial> ls
file.txt test.txt
arup@linux-wzza:~/Git_tutorial> git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# file.txt
nothing added to commit but untracked files present (use "git add" to track)
arup@linux-wzza:~/Git_tutorial> cat file.txt
hello
arup@linux-wzza:~/Git_tutorial> git checkout -b "file_branch"
Switched to a new branch 'file_branch'
arup@linux-wzza:~/Git_tutorial> cat file.txt
hello
arup@linux-wzza:~/Git_tutorial> echo "hello World" > file.txt
arup@linux-wzza:~/Git_tutorial> cat file.txt
hello World
arup@linux-wzza:~/Git_tutorial> git status
# On branch file_branch
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# file.txt
nothing added to commit but untracked files present (use "git add" to track)
arup@linux-wzza:~/Git_tutorial> git checkout master
Switched to branch 'master'
arup@linux-wzza:~/Git_tutorial> ls
file.txt test.txt
arup@linux-wzza:~/Git_tutorial> cat file.txt
hello World
arup@linux-wzza:~/Git_tutorial>
--
===============
Regards,
Arup Rakshit
next prev parent reply other threads:[~2014-05-20 18:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 15:38 untracked file deleted from the master branch, when checked out to it from a local branch Arup Rakshit
2014-05-20 16:56 ` Marius Storm-Olsen
2014-05-20 16:03 ` Arup Rakshit
2014-05-20 17:06 ` Marius Storm-Olsen
2014-05-20 17:20 ` Arup Rakshit
2014-05-20 18:24 ` Junio C Hamano
2014-05-20 17:40 ` Arup Rakshit [this message]
2014-05-20 18:44 ` Marius Storm-Olsen
2014-05-21 10:21 ` Sergei Organov
2014-05-20 18:29 ` Marius Storm-Olsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2654529.8c5AhJCJsq@linux-wzza.site \
--to=aruprakshit@rocketmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.