On 2017-04-04, at 6:32 PM, bestbrightestandthens...@gmail.com wrote:

> I have two directories. The one called bitbucket/source contains the cloned 
> repository which was set up by another developer and the other one is called 
> bitbucket/sourcecode which contains the same from my localhost so some of the 
> files in there have been modified due to code changes. So now supposedly I 
> create a branch and add those files from bitbucket/sourecode. A ridiculous 
> amount of work. I'm going to be spending 80% of my time on overhead now that 
> we have this new source control requirement. 

Repeating:

> 
> Again, you haven't provided any information about EXACTLY what you did. Which 
> directory did you switch to?
> 
> You can run "git status" from any directory within the workspace; by default 
> it shows the status of the entire workspace.
> 


And:
> $ git worktree add -b emergency-fix ../temp master
> 
> What kind of path is ../temp master ? That's not how I would write a path. 
> Maybe it's missing a slash and really is ../temp/master ?
It is two different args: "../temp" and "master"

Worktrees, as I understand it, are about letting one repository have two 
working directories with two different checkouts. Historically, git was 
designed on the assumption that one repository supported one checkout/one 
directory tree.

Maybe this is the key insight for you: one (normal; not sure about bare) 
repository per checkout. To switch from one branch to another, you commit what 
you are doing, and then do a clean switch (this is the "stash" command), or 
else when you switch, you are taking whatever diffs you have over to the other 
branch with a hidden merge (NB: you are taking the uncommitted diffs, not the 
files. If you need to move the files, stash first, do a clean switch, and then 
checkout the files from the stash. It took me a while to understand that point.)

===

I am now going to make some guesses, because we don't have the full information.

> I have two directories. The one called bitbucket/source contains the cloned 
> repository which was set up by another developer and the other one is called 
> bitbucket/sourcecode which contains the same from my localhost so some of the 
> files in there have been modified due to code changes. So now supposedly I 
> create a branch and add those files from bitbucket/sourecode. A ridiculous 
> amount of work. I'm going to be spending 80% of my time on overhead now that 
> we have this new source control requirement. 


My guess is this:

1. You've got an official repository on bitbucket.
2. Someone else set up bitbucket/source as that project.
3. If you go to "bitbucket/source", and type "git status", it will respond "On 
branch master, nothing to commit".

4. Over in bitbucket/sourcecode is a directory tree containing a copy of your 
codebase, that has been subjected to modifications by lots of other people.
5. This is *NOT* a git directory -- if you go to "bitbucket/sourcecode", and 
type "git status", git returns an error message about not in a repository.

Before anything else, can you please confirm these two points?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to