Re: [git-users] Include empty folders

2012-09-10 Thread Serge Matveenko
On Sat, Sep 8, 2012 at 7:38 PM, Mindcast Mindcast i...@mindcast.gr wrote:
 is there any way to include empty folders when i git commit without adding a
 file (like .gitignore or .gitkeep) ?

 As long as i know there is no official way to do this.

 But, is this something it can be implemented maybe in a future version ?

You may put .gitignore in such a directory containing:

*
!.gitignore


It will add .gitignore and will never add anything under this dir.


-- 
Serge Matveenko
se...@matveenko.ru
http://www.ohloh.net/accounts/lig
http://ru.linkedin.com/in/sergematveenko

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Process of branching

2012-09-10 Thread P Rouleau
Your steps seem to imply he must use the same new_branch_name in 1) and in 
5). We can simplify this by avoiding renaming the master branch. I believe 
it is already tracking the github's origin.

So the steps can be rewritten like this:
1) git branch feature_branch_name
2) git stash
3) git fetch
4) git reset --hard origin/master
5) git push origin feature_branch_name
6) git co feature_branch_name
7) git stash pop

First we create a feature_branch_name on the tip of the local master, since 
it is ahead of the origin's one.
Then we stash the local changes and we reset the master branch to the same 
commit than the origin (3  4). The fetch is required when 
many developers push to the same remote. (Always use reset with care, since 
we can loose work. In doubt, create a temporarily branch as a safety net.)
Then we create the feature branch on the remote (5). It does not need to be 
the current branch.
Then we switch to the feature branch (6) and we recover the stashed 
modifications to continue the work on the feature branch. We can skip 5 if 
we do not want to publish it now and want to add more commits before. 

After that, we simply push to origin to update it with the new commits, ie: 
git push. If we commited on many tracked branches but want to push only 
one, we have to specify the branch name, ie: git push origin branch_name.


On Sunday, September 9, 2012 3:04:46 PM UTC-4, RubyRedRick wrote:

 On Sun, Sep 9, 2012 at 12:53 PM, Patrick pn1@gmail.com 
 javascript:wrote:

 Local Repo
 12 commits ahead of origin/master

 How do I take those 12 commits and pull them off on a branch?


 I haven't tried this completely but since you haven't pushed the branch,I 
 think something like

 1) git branch -m master new_branch_name
 2) git fetch origin
 3) git branch --track master origin/master
 4) git checkout master
 5) git branch -f new_branch_name master
 6) git config branch.new_branch_namel.merge refs/heads/new_branch_name
 7) git checkout new_branch_name
 8) git push origin new_branch_name:refs/heads/new_branch_name


 First we give the local master branch the new name (1).
 Then we make sure we have the latest changes from master (2).
 Then we create a new local master branch which tracks the remote master 
 (3).
 We then checkout the master branch(4) to allow us to set the starting 
 point of the new branch(5)
 Next we tell the new branch to merge changes to the right branch on origin 
 (6) Note this remote branch won't exist yet.
 Finally we checkout the new local branch(7) and push it to the remote repo.

 -- 
 Rick DeNatale

 Google+: +Rick DeNatale https://plus.google.com/10254117893106790
 Blog: http://talklikeaduck.denhaven2.com/
 Github: http://github.com/rubyredrick
 Twitter: @RickDeNatale
 WWR: http://www.workingwithrails.com/person/9021-rick-denatale
 LinkedIn: http://www.linkedin.com/in/rickdenatale
  

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/EaUut-bfetkJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Process of branching

2012-09-10 Thread Rick DeNatale
On Mon, Sep 10, 2012 at 7:25 AM, P Rouleau proulea...@gmail.com wrote:

 Your steps seem to imply he must use the same new_branch_name in 1) and in
 5). We can simplify this by avoiding renaming the master branch. I believe
 it is already tracking the github's origin.

 So the steps can be rewritten like this:
 1) git branch feature_branch_name
 2) git stash
 3) git fetch
 4) git reset --hard origin/master
 5) git push origin feature_branch_name
 6) git co feature_branch_name
 7) git stash pop

 First we create a feature_branch_name on the tip of the local master,
 since it is ahead of the origin's one.
 Then we stash the local changes and we reset the master branch to the same
 commit than the origin (3  4). The fetch is required when
 many developers push to the same remote. (Always use reset with care, since
 we can loose work. In doubt, create a temporarily branch as a safety net.)
 Then we create the feature branch on the remote (5). It does not need to
 be the current branch.
 Then we switch to the feature branch (6) and we recover the stashed
 modifications to continue the work on the feature branch. We can skip 5 if
 we do not want to publish it now and want to add more commits before.

 After that, we simply push to origin to update it with the new commits,
 ie: git push. If we commited on many tracked branches but want to push only
 one, we have to specify the branch name, ie: git push origin branch_name.


The problem is he said that he already made 12 commits to master in his
local repo.  So that stash will only save any uncommitted changes since the
last commit.

I believe that my suggestion will leave him in the same state as if he had
started the branch at the 'right' time in the past.

-- 
Rick DeNatale

Google+: +Rick DeNatale https://plus.google.com/10254117893106790
Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Process of branching

2012-09-10 Thread Łukasz Siwiński
Hmm...

 Local Repo 12 commits ahead of origin/master

means, that You haven't pushed your last 12 commits to remote (@github)
origin/master branch

if you do:

git push
# what is the same as
git push origin master

then You'll see your changes on github.
10-09-2012 14:14, Rick DeNatale rick.denat...@gmail.com napisał(a):


 On Mon, Sep 10, 2012 at 7:25 AM, P Rouleau proulea...@gmail.com wrote:

 Your steps seem to imply he must use the same new_branch_name in 1) and
 in 5). We can simplify this by avoiding renaming the master branch. I
 believe it is already tracking the github's origin.

 So the steps can be rewritten like this:
 1) git branch feature_branch_name
 2) git stash
 3) git fetch
 4) git reset --hard origin/master
 5) git push origin feature_branch_name
 6) git co feature_branch_name
 7) git stash pop

 First we create a feature_branch_name on the tip of the local master,
 since it is ahead of the origin's one.
 Then we stash the local changes and we reset the master branch to the
 same commit than the origin (3  4). The fetch is required when
 many developers push to the same remote. (Always use reset with care, since
 we can loose work. In doubt, create a temporarily branch as a safety net.)
 Then we create the feature branch on the remote (5). It does not need to
 be the current branch.
 Then we switch to the feature branch (6) and we recover the stashed
 modifications to continue the work on the feature branch. We can skip 5 if
 we do not want to publish it now and want to add more commits before.

 After that, we simply push to origin to update it with the new commits,
 ie: git push. If we commited on many tracked branches but want to push only
 one, we have to specify the branch name, ie: git push origin branch_name.


 The problem is he said that he already made 12 commits to master in his
 local repo.  So that stash will only save any uncommitted changes since the
 last commit.

 I believe that my suggestion will leave him in the same state as if he had
 started the branch at the 'right' time in the past.

 --
 Rick DeNatale

 Google+: +Rick DeNatale https://plus.google.com/10254117893106790
 Blog: http://talklikeaduck.denhaven2.com/
 Github: http://github.com/rubyredrick
 Twitter: @RickDeNatale
 WWR: http://www.workingwithrails.com/person/9021-rick-denatale
 LinkedIn: http://www.linkedin.com/in/rickdenatale

 --
 You received this message because you are subscribed to the Google Groups
 Git for human beings group.
 To post to this group, send email to git-users@googlegroups.com.
 To unsubscribe from this group, send email to
 git-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/git-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Process of branching

2012-09-10 Thread Rick DeNatale
OP = Original Poster

On Mon, Sep 10, 2012 at 11:59 AM, Łukasz Siwiński lsiwin...@gmail.comwrote:

 Ok, maybe I've misunderstood his problem. But now I'm sure I really know
 what does your answer script do , thanks a lot :-)

 PS: what does mean OP in this context?

 Pozdrawiam,

 --
 Łukasz Siwiński
 http://siwinski.info

 Wysłano z telefonu.
 10-09-2012 17:22, Rick DeNatale rick.denat...@gmail.com napisał(a):

  On Mon, Sep 10, 2012 at 8:55 AM, Łukasz Siwiński lsiwin...@gmail.comwrote:

 Hmm...

  Local Repo 12 commits ahead of origin/master

 means, that You haven't pushed your last 12 commits to remote (@github)
 origin/master branch

 if you do:

 git push
 # what is the same as
 git push origin master

 then You'll see your changes on github.


 First of all, it's not me it's the OP.  and unless I misunderstood him,
 that's what he DOESN'T want to do.

 Here's my understanding of his dilemma:

 First some time ago he fetched master from remote then he made some
 changes, commited locally, and repeated 11 more times.

 Now he realizes that before making those changes he should have created a
 new branch.


 10-09-2012 14:14, Rick DeNatale rick.denat...@gmail.com napisał(a):


 On Mon, Sep 10, 2012 at 7:25 AM, P Rouleau proulea...@gmail.comwrote:

 Your steps seem to imply he must use the same new_branch_name in 1)
 and in 5). We can simplify this by avoiding renaming the master branch. I
 believe it is already tracking the github's origin.

 So the steps can be rewritten like this:
 1) git branch feature_branch_name
 2) git stash
 3) git fetch
 4) git reset --hard origin/master
 5) git push origin feature_branch_name
 6) git co feature_branch_name
 7) git stash pop

 First we create a feature_branch_name on the tip of the local master,
 since it is ahead of the origin's one.
 Then we stash the local changes and we reset the master branch to the
 same commit than the origin (3  4). The fetch is required when
 many developers push to the same remote. (Always use reset with care, 
 since
 we can loose work. In doubt, create a temporarily branch as a safety net.)
 Then we create the feature branch on the remote (5). It does not need
 to be the current branch.
 Then we switch to the feature branch (6) and we recover the stashed
 modifications to continue the work on the feature branch. We can skip 5 if
 we do not want to publish it now and want to add more commits before.

 After that, we simply push to origin to update it with the new
 commits, ie: git push. If we commited on many tracked branches but want to
 push only one, we have to specify the branch name, ie: git push origin
 branch_name.


 The problem is he said that he already made 12 commits to master in his
 local repo.  So that stash will only save any uncommitted changes since the
 last commit.

 I believe that my suggestion will leave him in the same state as if he
 had started the branch at the 'right' time in the past.

 --
 Rick DeNatale

 Google+: +Rick DeNatale https://plus.google.com/10254117893106790
 Blog: http://talklikeaduck.denhaven2.com/
 Github: http://github.com/rubyredrick
 Twitter: @RickDeNatale
 WWR: http://www.workingwithrails.com/person/9021-rick-denatale
 LinkedIn: http://www.linkedin.com/in/rickdenatale

 --
 You received this message because you are subscribed to the Google
 Groups Git for human beings group.
 To post to this group, send email to git-users@googlegroups.com.
 To unsubscribe from this group, send email to
 git-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/git-users?hl=en.

  --
 You received this message because you are subscribed to the Google
 Groups Git for human beings group.
 To post to this group, send email to git-users@googlegroups.com.
 To unsubscribe from this group, send email to
 git-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/git-users?hl=en.




 --
 Rick DeNatale

 Google+: +Rick DeNatale https://plus.google.com/10254117893106790
 Blog: http://talklikeaduck.denhaven2.com/
 Github: http://github.com/rubyredrick
 Twitter: @RickDeNatale
 WWR: http://www.workingwithrails.com/person/9021-rick-denatale
 LinkedIn: http://www.linkedin.com/in/rickdenatale

 --
 You received this message because you are subscribed to the Google Groups
 Git for human beings group.
 To post to this group, send email to git-users@googlegroups.com.
 To unsubscribe from this group, send email to
 git-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/git-users?hl=en.

  --
 You received this message because you are subscribed to the Google Groups
 Git for human beings group.
 To post to this group, send email to git-users@googlegroups.com.
 To unsubscribe from this group, send email to
 git-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/git-users?hl=en.




-- 
Rick DeNatale


Re: [git-users] Process of branching

2012-09-10 Thread Patrick
Thanks everyone.  It has taken me awhile to try this out.  So what I did 
was file system copy my local repo and then try the techniques offered. 
 The first one was (note I named my branch parser):

1. git branch -m master parser
2. git fetch origin
3. git branch --track master origin/master
4. git checkout master
5. git branch -f parser master
6. git config branch.parserl.merge refs/heads/parser
7. git checkout parser
8. git push origin parser:refs/heads/parser

I didn't do step 8 yet.  This kind of worked up until step 5 which made 
both master and parser look the same.  Steps 6 and 7 didn't seem to change 
anything and the repo was left in a state that matches origin/master. 
 However it I don't do steps 4,5, and 6 the local branch master looks like 
origin/master and local branch parser has my 12 commits listed in the 
history.  I think this is what I want.  Oh and on step 6 I thought it might 
be a spell error and also tried branch.parser.merge but that didn't change 
the outcome.

The second answer way was (again my branch name is parser):

1. git branch parser
2. git stash
3. git fetch
4. git reset --hard origin/master
5. git push origin parser
6. git co parser
7. git stash pop

I didn't do step 5 yet.  This kind of worked but the stashing wasn't 
needed.  So skipping step 2 and 7 left me with 2 local branches of master 
and parser.  Looking at the histories the local branch master looks like 
origin/master and local branch parser has my 12 commits listed in the 
history.  Again I think this is what I want.  So if I'm correct and my 
parser branch has the 12 commits and master looks like origin/master then I 
really have 2 ways to do this:

# way 1
1. git branch -m master parser
2. git fetch origin
3. git branch --track master origin/master
4. git checkout parser

# way 2
1. git branch parser
3. git fetch
4. git reset --hard origin/master
5. git checkout parser

Then I can push it to the remote if I want (but I'll probably work on the 
branch locally and not push it up until I merge it back into master branch):

1. git push origin parser

I'm not sure if either process is better and I may not fully get it, but it 
seems to me that they both work. 

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/U-HtHHIL_p8J.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Process of branching

2012-09-10 Thread P Rouleau
And Thanks to you for your feed-back.

On Monday, September 10, 2012 4:18:38 PM UTC-4, Patrick wrote:

 Now that I have done both methods and I confirmed that the state of the 
 local repo is pretty much the same, either method will work fine for me.  I 
 have done this on my working local repo (using way 2) and even pushed it up 
 to the remote just to test it completely.  The first method moves (renames) 
 the branch master to parser and then recreates and connects to the remote 
 master branch.  The second creates the parser branch and then does a hard 
 reset of the local master branch to the remote master branch.  If I'd have 
 known that git branch new branch name takes all current local commits 
 into account (which now that I think about it makes sense but I was 
 thinking about it from a remote point of view...) then I might have been 
 able to come up either process.  It might have been just a matter of 
 creating the parser branch and then look at the histories of master and 
 parser.  

 Just have to make sure you local is all checked in or use stash to pop it 
 in later.  

 Thanks RubyRedRick and P Rouleau for your ideas!

 On Monday, September 10, 2012 10:31:26 AM UTC-7, Patrick wrote:

 ... 

 # way 1
 1. git branch -m master parser
 2. git fetch origin
 3. git branch --track master origin/master
 4. git checkout parser

 # way 2
 1. git branch parser
 2. git fetch
 3. git reset --hard origin/master
 4. git checkout parser
 ...



-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/VQ7eYIknrQEJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.