Re: Basic Git usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 14, 2010 at 8:32 AM, hogsolo <greg@xxxxxxxxxxxxx> wrote:
>
> I have a master repo and have created a branch. I want to work in both at
> the same time. I want to change some files in the master, then switch to the
> branch ( git checkout branchname) , work on some files, then switch back to
> the master.
> However git wont let me switch back to the master until I have added,
> committed and pushed my files in the branch.

If you have modified files that are different between two branches then
Git won't allow to switch between them. You have two options:
- to commit your changes
- use "git stash"

In contrast to SVN and some other VCS, Git allows you to amend any commit
later. To amend the last commit on the current branch, 'git commit --amend'
can be used. If you want to modify arbitrary commits, (or squash, or delete
some commits) take a look at: "git rebase --interactive"

Warning: modifying commits that you published (i.e. made available to
other users) is in general a bad idea, because it makes difficult for
other users to work with you.


Dmitry
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]