[git-users] How can I cleanly fix this problem?

2016-10-26 Thread James T
(Apologies for any git-newbie misnomers in this problem statement.)

I have a project where we've been using tags on the master branch to 
designate official releases.

I belatedly noticed a commit that is included in one of those tagged 
releases that contains an error.  Since that time, however, a number of new 
commits have been added to the master branch.

Is there some way to cleanly add my new commit to fix the latent problem 
such that it is now included in the original tagged release without any of 
the newer commits being added to that tag?

Perhaps a text "picture will help...


master branch   A  B  === C === D 
| 
\_ Tag-rel2
|
Tag-rel1

Tag-rel1 was created when only commits A and B existed.  I have now 
belatedly discovered that commit A introduced an error.  In the meanwhile, 
development continued, and commits C and D have been merged into the master 
branch, and a second release Tag-rel2 was created.  Is there some way to 
belatedly fix commit A such that Tag-rel1 now represents what I wanted in 
the first place?

Thanks in advance for any light you can shed.

-- 
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.


[git-users] Re: http.savecookies option didn't work?

2016-10-26 Thread Makson Lee


On Wednesday, October 26, 2016 at 8:12:07 PM UTC+8, Makson Lee wrote:
>
> tried the following command, but no cookie file was produced, did i do 
> anything wrong?
>
> $ git init
> $ git config http.cookieFile cookie.txt
> $ git config http.saveCookies true
> $ git fetch http://gerrit.domain:8080/p/test master
> Username for 'http://gerrit.domain:8080': user
> Password for 'http://user@gerrit.domain:8080': xx
> From http://gerrit.domain:8080/p/test
>  * branchmaster-> FETCH_HEAD
>

got the answer [1], open-source version gerrit does not support passing 
http passwords as cookies.

[1] https://groups.google.com/forum/#!topic/repo-discuss/T1DNxkuxBiU 

-- 
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.


[git-users] http.savecookies option didn't work?

2016-10-26 Thread Makson Lee
tried the following command, but no cookie file was produced, did i do 
anything wrong?

$ git init
$ git config http.cookieFile cookie.txt
$ git config http.saveCookies true
$ git fetch http://gerrit.domain:8080/p/test master
Username for 'http://gerrit.domain:8080': user
Password for 'http://user@gerrit.domain:8080': xx
>From http://gerrit.domain:8080/p/test
 * branchmaster-> FETCH_HEAD

-- 
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.


Re: [git-users] Try as I might, I just don't understand git. Can anyone please help me out?

2016-10-26 Thread Gergely Polonkai
I think what you read as “not a correct branch” is actually “not currently
on a branch”, which is perfectly normal during a merge conflict (and my
wild guess is that’s what you mean you were “kicked out of a branch”, too.)

When you bump into a merge conflict, you get in a so-called detached HEAD
state. It sounds gory, but all that happens is your HEAD (generally
speaking, the commit whose snapshot you can see in your working directory)
is detached from your branches. After you resolve the conflict and use git
commit, your HEAD gets reattached to your branch.

On Wed, Oct 26, 2016, 01:10 AD S  wrote:

> Hey, thanks for your reply.
>
> I'll try to put up the error from my Stack Overflow questions, but I might
> not be able to remember them all verbatim. My answers in green below.
>
>
>- Got error saying I was on the wrong branch, when I wasn't (this just
>after a `git commit` command on a new branch).
>
>
> Error I got read something like:
> Execution of target "commit" failed for the following reason: You are not
> on the correct branch.
>
>
> "As commits are snapshots of the whole “project” you can not pull changes
> to only a set of files; you will get everything."
>
> The project I am working on has about 30 sites (Drupal sub sites) with
> thousands of files. So you're saying, if I need to work on 1 changed file I
> will have to pull all these others?
>
> What do you mean “kicked out”? As Git does not have access control built
> in, it cannot deny you from accessing a branch. Again, it would be helpful
> to see an error message
>
> This happens after I get a merge error. I fix it, and then go to commit
> again but get the error: "You are not on the correct branch."Using
> git branch reveals I am no longer on my branch. If I try to switch back to
> my branch I get an error saying something like "Please, commit your
> changes or stash them before you can switch branches."
>
> git-merge output will not necessarily show you which files have conflicts
> (although it is possible to parse it by eye). If you need such information,
> use git status.
>
>
>
> This does still happen when I use 'git status'
>
> Sorry if this isnt really enough information. I'm really not sure what's
> going on.
>
> On Tuesday, October 25, 2016 at 5:32:40 PM UTC+10, Gergely Polonkai wrote:
>
>
>
> On Tue, Oct 25, 2016, 07:53 AD S  wrote:
>
> Honestly I must have watched hours of videos and completed 4 or 5 online
> tutorials and it's still not clicking.
>
>
> Could you show us which ones? The errors
>
>
> I understand the concept: that git is a sub-versioning tool. It makes
> sense. I know why one would use it.
>
>
> Let's just call it Version Control System. subversion is another tool with
> the same purpose.
>
>
> But every time I try to use it something just breaks or goes wrong or
> blows up.
>
> This has happened just this week, for example:
>
>
>- Got error saying I was on the wrong branch, when I wasn't (this just
>after a `git commit` command on a new branch).
>
> git never says you are on a wrong branch. Could you show us the exact
> error message ?
>
>
>- After a being able to commit and push to github all last week, I
>randomly got a 'Connection refused' message (github.com was still up).
>
> There are tons of reasons that can lead to such an error message, most of
> them being related to network issues, not Git.
>
>
>- Went to pull 7 files from a branch but for some reason, this time,
>it pulled hundreds of files from the whole, broader project.
>
> As commits are snapshots of the whole “project”, you can not pull changes
> to only a set of files; you will get everything.
>
>
>- A few times I got kicked out of the branch after a failed commit and
>wouldn't let me return to branch because I had files waiting to be
>committed. Only way was to hard reset.
>
> What do you mean “kicked out”? As Git does not have access control built
> in, it cannot deny you from accessing a branch. Again, it would be helpful
> to see an error message .
>
>
>- Saying there are merge conflict issues, but not showing what files
>there are on.
>
> git-merge output will not necessarily show you which files have conflicts
> (although it is possible to parse it by eye). If you need such information,
> use git status.
>
>
>- Files that were tracked randomly become un-tracked.
>
> That means they were removed from tracking either by you or by someone
> else, e.g. with git-rm
>
> These are a few, but in reality many similar problems happen throughout
> the day which really impacts my productivity. When I started, and studied,
> git I thought it would be pretty straight forward: pull the files you want
> to work on, make changes, push them and if there is a conflict error fix
> it. But it's complexity is beyond me.
>
> So, am I just cursed? What am I missing here?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
>
> To unsubscribe