You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Om <bi...@gmail.com> on 2013/03/20 00:33:54 UTC

Git basics for SVN users

Here is an excellent primer comparing the commands available in Git for
their equivalent SVN functionalities.

http://git.or.cz/course/svn.html

I strongly suggest everyone go through this document in its entirety.

Re: Git basics for SVN users

Posted by Dasa Paddock <dp...@esri.com>.
The Apache Cordova wiki has pages explaining how to use Git and GitHub for both contributors and committers. They aren't using the exact same nvie.com git flow branching model, but much of the content seems applicable to Flex as well.

http://wiki.apache.org/cordova/ContributorWorkflow
http://wiki.apache.org/cordova/CommitterWorkflow

--Dasa

Re: Git basics for SVN users

Posted by Peter Ent <pe...@adobe.com>.
+1 from me on a basics list (from Justin's email earlier in this thread).

I've been watching and reading these threads as carefully as possible. I'm
working with Alex on FlexJS and my git experience is minimal. I've found
conflicting "best practices" in git information, so it would be good to
have a definitive reference for our Apache Flex project. I've downloaded
Sourcetree and I'll see how I like that. So far it seems fine with the
flex-sdk changes it detected.

I'll also try to be more present on these lists and add my opinion. I
think we're headed in the right direction, but I do see conflicting git
information, esp about merge and rebasing, but we'll sort it out. Let's
all just have patience if someone gets it wrong and help them out.

Peter Ent

Adobe Systems

On 3/20/13 1:20 PM, "Gordon Smith" <go...@adobe.com> wrote:

>> "git checkout" is not the same as "svn revert"
>
>If you have edited a file then doing
>
>    git checkout <file>
>
>restores its contents to those in the repo. So isn't that a "revert"?
>
>- Gordon
>
>-----Original Message-----
>From: Justin Mclean [mailto:justin@classsoftware.com]
>Sent: Tuesday, March 19, 2013 8:59 PM
>To: dev@flex.apache.org
>Subject: Re: Git basics for SVN users
>
>Hi,
>
>> Here is an excellent primer comparing the commands available in Git
>> for their equivalent SVN functionalities.
>> 
>> http://git.or.cz/course/svn.html
>
>Just a warning what it has under revert is incorrect! "git checkout" is
>not the same as "svn revert".
>
>Justin
>
>


RE: Git basics for SVN users

Posted by Gordon Smith <go...@adobe.com>.
> "git checkout" is not the same as "svn revert"

If you have edited a file then doing

    git checkout <file>

restores its contents to those in the repo. So isn't that a "revert"?

- Gordon

-----Original Message-----
From: Justin Mclean [mailto:justin@classsoftware.com] 
Sent: Tuesday, March 19, 2013 8:59 PM
To: dev@flex.apache.org
Subject: Re: Git basics for SVN users

Hi,

> Here is an excellent primer comparing the commands available in Git 
> for their equivalent SVN functionalities.
> 
> http://git.or.cz/course/svn.html

Just a warning what it has under revert is incorrect! "git checkout" is not the same as "svn revert".

Justin



Re: Git basics for SVN users

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> Here is an excellent primer comparing the commands available in Git for
> their equivalent SVN functionalities.
> 
> http://git.or.cz/course/svn.html

Just a warning what it has under revert is incorrect! "git checkout" is not the same as "svn revert".

Justin



Re: Git basics for SVN users

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

Another question for users and committers:

1.7 How do I revert/discard a changed file to develop head?

Git reset file followed by git checkout or is it git reset -- and git checkout --- ? What about the "--hard" option? When is it required? (or --soft for that mater?) Is there a single command that will revert in git?

Justin

RE: Git basics for SVN users

Posted by Gordon Smith <go...@adobe.com>.
+1

For Users and Committers, we also need

1.5 How do I update my project to have the latest changes that committers have made?

- Gordon

-----Original Message-----
From: Justin Mclean [mailto:justin@classsoftware.com] 
Sent: Tuesday, March 19, 2013 5:15 PM
To: dev@flex.apache.org
Subject: Re: Git basics for SVN users

Hi,

It would be great to have docs along the line of this for our project:

http://git-scm.com/docs/everyday

Describing what commands users, committers and release managers need to be aware of and use in real situations.

A rough outline (and we should know most of the answers here).

Users
1. How do I check out?
2. how do I make a patch?
3. How do I submit a patch?

Committers
1. How do I check out?
2. How do I apply a patch?
3. How to I commit/push?
4. how do I revert/rollback changes if someone made an error?
5. What should I put in JIRA?
6. How do I work on and apply a bug fix?
7. How do I work on and apply a new feature?
8. How do I work on a new feature with other people?

Release Manager
1. How do I branch to make a release?
2. How do I work out what's included in the release?
3. How do I merge fixes from develop in the release?
4. How do I tag the release?
5. How do I merge the release back into develop?
6. How do I apply hot fixes to the release?

Perhaps also a list of GIT dos and don't dos?

Anyone think of other questions? Anyone up for putting this on the wiki and working on it?

Thanks,
Justin

Re: Git basics for SVN users

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

It would be great to have docs along the line of this for our project:

http://git-scm.com/docs/everyday

Describing what commands users, committers and release managers need to be aware of and use in real situations.

A rough outline (and we should know most of the answers here).

Users
1. How do I check out?
2. how do I make a patch?
3. How do I submit a patch?

Committers
1. How do I check out?
2. How do I apply a patch?
3. How to I commit/push?
4. how do I revert/rollback changes if someone made an error?
5. What should I put in JIRA?
6. How do I work on and apply a bug fix?
7. How do I work on and apply a new feature?
8. How do I work on a new feature with other people?

Release Manager
1. How do I branch to make a release?
2. How do I work out what's included in the release?
3. How do I merge fixes from develop in the release?
4. How do I tag the release?
5. How do I merge the release back into develop?
6. How do I apply hot fixes to the release?

Perhaps also a list of GIT dos and don't dos?

Anyone think of other questions? Anyone up for putting this on the wiki and working on it?

Thanks,
Justin

Re: Git basics for SVN users

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> Of course, as the page says, the most current version of this primer course
> has been moved here: http://git-scm.com/course/svn.html   Please use this
> link instead.

A nice primer but it lacks context for our project and has nothing about all the options Git people are saying we need to use so as such may be a little misleading.

It does have more about git pull (including -rebase) here:
http://git-scm.com/docs/git-pull

But states:
"Note This is a potentially dangerous mode of operation. It rewrites history, which does not bode well when you published that history already. Do not use this option unless you have read git-rebase(1) carefully."

Again do we think it wise to encourage "git pull -rebase" by non expert git users?

Justin

Re: Git basics for SVN users

Posted by Om <bi...@gmail.com>.
On Mar 19, 2013 8:42 PM, "Alex Harui" <ah...@adobe.com> wrote:
>
> Hmm.
>
> I had a bunch of outstanding SVN changes that got locked out during the
> migration.  I was able to copy them over to the git repo and make a series
> of commits.  It was much like SVN.  "add" new files.  "commit" with
> messages.  "diff" was a bit tricker but I got it to work.  I'll definitely
> have to look it up next time I need it.
>
> Now if I could only push to the asjs repo, I would be able to find out how
> the next step works.
>
> I am concerned about pulling and pushing, but I think we will figure it
out.
>
> I might end up cloning a repo more than once in order to work on more than
> one branch at a time.  But honestly, I did that in SVN too in order to
> handle patches and making a second working copy took "forever" in SVN and
is
> lightning fast in Git.
>
> So far, so good for me.  Now can we open up all the repos?
>

+1

Thanks,
Om

>
> On 3/19/13 6:02 PM, "Gordon Smith" <go...@adobe.com> wrote:
>
> > Option 1 for specifying what to commit is
> >
> >> by using git add to incrementally "add" changes to the index before
using the
> >> commit command (Note: even modified files must be "added");
> >
> > Every tutorial I read used the 'add'-after-editing-before-committing
approach.
> > Even more "interesting", if I understand correctly, is the fact that
you can
> > 'add' an edit, then edit the same file some more, and the additional
edits
> > will NOT be committed. So 'add' doesn't simply put the file into a
state to be
> > committed; it must copy the current contents of the file for later
commitment.
> > Very few of the tutorials bother to mention this, but it's hard to
imagine
> > something more important for everyday development workflow.
> >
> > - Gordon
> >
> >
> > -----Original Message-----
> > From: Dasa Paddock [mailto:dpaddock@esri.com]
> > Sent: Tuesday, March 19, 2013 5:39 PM
> > To: <de...@flex.apache.org>
> > Subject: Re: Git basics for SVN users
> >
> > There are 5 ways listed here to specify the contents of a commit:
> > http://git-scm.com/docs/git-commit
> >
> > Options 3 and 4 do not use the index/stage:
> >
> > * by listing files as arguments to the commit command, in which case the
> > commit will ignore changes staged in the index, and instead record the
current
> > content of the listed files (which must already be known to git);
> >
> > * by using the -a switch with the commit command to automatically "add"
> > changes from all known files (i.e. all files that are already listed in
the
> > index) and to automatically "rm" files in the index that have been
removed
> > from the working tree, and then perform the actual commit;"
> >
> > --Dasa
> >
> > On Mar 19, 2013, at 5:28 PM, Om <bi...@gmail.com>
> >  wrote:
> >
> >> On Tue, Mar 19, 2013 at 5:06 PM, Gordon Smith <go...@adobe.com>
wrote:
> >>
> >>> In discussing 'git add', 'git rm', and 'git mv', this document says
> >>> "So, just like in SVN, you need to tell Git when you add, move or
> >>> remove any files." It makes it sound like these work the same way in
Git and
> >>> in SVN.
> >>
> >> In fact, don't I have to use 'git add' after I have simply edited an
> >>> existing file? That's quite different from SVN where I can just edit
> >>> and commit. (What could be simpler?)
> >>>
> >>
> >> No you dont have to do  'git add' after an edit.  Where in the
> >> document does it say that?  Edit and commit just the same way in git
as well.
> >>
> >>
> >>>
> >>> That makes me wonder how accurate this document is elsewhere.
> >>>
> >>> - Gordon
> >>>
> >>> -----Original Message-----
> >>> From: omuppi1@gmail.com [mailto:omuppi1@gmail.com] On Behalf Of Om
> >>> Sent: Tuesday, March 19, 2013 4:39 PM
> >>> To: dev@flex.apache.org
> >>> Subject: Re: Git basics for SVN users
> >>>
> >>> Of course, as the page says, the most current version of this primer
course
> >>> has been moved here: http://git-scm.com/course/svn.html   Please use
this
> >>> link instead.
> >>>
> >>> Thanks,
> >>> Om
> >>>
> >>> On Tue, Mar 19, 2013 at 4:33 PM, Om <bi...@gmail.com> wrote:
> >>>
> >>>> Here is an excellent primer comparing the commands available in Git
> >>>> for their equivalent SVN functionalities.
> >>>>
> >>>> http://git.or.cz/course/svn.html
> >>>>
> >>>> I strongly suggest everyone go through this document in its entirety.
> >>>>
> >>>
> >
>
> --
> Alex Harui
> Flex SDK Team
> Adobe Systems, Inc.
> http://blogs.adobe.com/aharui
>

Re: Git basics for SVN users

Posted by Alex Harui <ah...@adobe.com>.
Hmm.

I had a bunch of outstanding SVN changes that got locked out during the
migration.  I was able to copy them over to the git repo and make a series
of commits.  It was much like SVN.  "add" new files.  "commit" with
messages.  "diff" was a bit tricker but I got it to work.  I'll definitely
have to look it up next time I need it.

Now if I could only push to the asjs repo, I would be able to find out how
the next step works.

I am concerned about pulling and pushing, but I think we will figure it out.

I might end up cloning a repo more than once in order to work on more than
one branch at a time.  But honestly, I did that in SVN too in order to
handle patches and making a second working copy took "forever" in SVN and is
lightning fast in Git.

So far, so good for me.  Now can we open up all the repos?


On 3/19/13 6:02 PM, "Gordon Smith" <go...@adobe.com> wrote:

> Option 1 for specifying what to commit is
> 
>> by using git add to incrementally "add" changes to the index before using the
>> commit command (Note: even modified files must be "added");
> 
> Every tutorial I read used the 'add'-after-editing-before-committing approach.
> Even more "interesting", if I understand correctly, is the fact that you can
> 'add' an edit, then edit the same file some more, and the additional edits
> will NOT be committed. So 'add' doesn't simply put the file into a state to be
> committed; it must copy the current contents of the file for later commitment.
> Very few of the tutorials bother to mention this, but it's hard to imagine
> something more important for everyday development workflow.
> 
> - Gordon
> 
> 
> -----Original Message-----
> From: Dasa Paddock [mailto:dpaddock@esri.com]
> Sent: Tuesday, March 19, 2013 5:39 PM
> To: <de...@flex.apache.org>
> Subject: Re: Git basics for SVN users
> 
> There are 5 ways listed here to specify the contents of a commit:
> http://git-scm.com/docs/git-commit
> 
> Options 3 and 4 do not use the index/stage:
> 
> * by listing files as arguments to the commit command, in which case the
> commit will ignore changes staged in the index, and instead record the current
> content of the listed files (which must already be known to git);
> 
> * by using the -a switch with the commit command to automatically "add"
> changes from all known files (i.e. all files that are already listed in the
> index) and to automatically "rm" files in the index that have been removed
> from the working tree, and then perform the actual commit;"
> 
> --Dasa
> 
> On Mar 19, 2013, at 5:28 PM, Om <bi...@gmail.com>
>  wrote:
> 
>> On Tue, Mar 19, 2013 at 5:06 PM, Gordon Smith <go...@adobe.com> wrote:
>> 
>>> In discussing 'git add', 'git rm', and 'git mv', this document says
>>> "So, just like in SVN, you need to tell Git when you add, move or
>>> remove any files." It makes it sound like these work the same way in Git and
>>> in SVN.
>> 
>> In fact, don't I have to use 'git add' after I have simply edited an
>>> existing file? That's quite different from SVN where I can just edit
>>> and commit. (What could be simpler?)
>>> 
>> 
>> No you dont have to do  'git add' after an edit.  Where in the
>> document does it say that?  Edit and commit just the same way in git as well.
>> 
>> 
>>> 
>>> That makes me wonder how accurate this document is elsewhere.
>>> 
>>> - Gordon
>>> 
>>> -----Original Message-----
>>> From: omuppi1@gmail.com [mailto:omuppi1@gmail.com] On Behalf Of Om
>>> Sent: Tuesday, March 19, 2013 4:39 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: Git basics for SVN users
>>> 
>>> Of course, as the page says, the most current version of this primer course
>>> has been moved here: http://git-scm.com/course/svn.html   Please use this
>>> link instead.
>>> 
>>> Thanks,
>>> Om
>>> 
>>> On Tue, Mar 19, 2013 at 4:33 PM, Om <bi...@gmail.com> wrote:
>>> 
>>>> Here is an excellent primer comparing the commands available in Git
>>>> for their equivalent SVN functionalities.
>>>> 
>>>> http://git.or.cz/course/svn.html
>>>> 
>>>> I strongly suggest everyone go through this document in its entirety.
>>>> 
>>> 
> 

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


RE: Git basics for SVN users

Posted by Gordon Smith <go...@adobe.com>.
Option 1 for specifying what to commit is

   > by using git add to incrementally "add" changes to the index before using the commit command (Note: even modified files must be "added");

Every tutorial I read used the 'add'-after-editing-before-committing approach. Even more "interesting", if I understand correctly, is the fact that you can 'add' an edit, then edit the same file some more, and the additional edits will NOT be committed. So 'add' doesn't simply put the file into a state to be committed; it must copy the current contents of the file for later commitment. Very few of the tutorials bother to mention this, but it's hard to imagine something more important for everyday development workflow.

- Gordon


-----Original Message-----
From: Dasa Paddock [mailto:dpaddock@esri.com] 
Sent: Tuesday, March 19, 2013 5:39 PM
To: <de...@flex.apache.org>
Subject: Re: Git basics for SVN users

There are 5 ways listed here to specify the contents of a commit:
http://git-scm.com/docs/git-commit

Options 3 and 4 do not use the index/stage:

	* by listing files as arguments to the commit command, in which case the commit will ignore changes staged in the index, and instead record the current content of the listed files (which must already be known to git);

	* by using the -a switch with the commit command to automatically "add" changes from all known files (i.e. all files that are already listed in the index) and to automatically "rm" files in the index that have been removed from the working tree, and then perform the actual commit;"

--Dasa

On Mar 19, 2013, at 5:28 PM, Om <bi...@gmail.com>
 wrote:

> On Tue, Mar 19, 2013 at 5:06 PM, Gordon Smith <go...@adobe.com> wrote:
> 
>> In discussing 'git add', 'git rm', and 'git mv', this document says 
>> "So, just like in SVN, you need to tell Git when you add, move or 
>> remove any files." It makes it sound like these work the same way in Git and in SVN.
> 
> In fact, don't I have to use 'git add' after I have simply edited an
>> existing file? That's quite different from SVN where I can just edit 
>> and commit. (What could be simpler?)
>> 
> 
> No you dont have to do  'git add' after an edit.  Where in the 
> document does it say that?  Edit and commit just the same way in git as well.
> 
> 
>> 
>> That makes me wonder how accurate this document is elsewhere.
>> 
>> - Gordon
>> 
>> -----Original Message-----
>> From: omuppi1@gmail.com [mailto:omuppi1@gmail.com] On Behalf Of Om
>> Sent: Tuesday, March 19, 2013 4:39 PM
>> To: dev@flex.apache.org
>> Subject: Re: Git basics for SVN users
>> 
>> Of course, as the page says, the most current version of this primer course
>> has been moved here: http://git-scm.com/course/svn.html   Please use this
>> link instead.
>> 
>> Thanks,
>> Om
>> 
>> On Tue, Mar 19, 2013 at 4:33 PM, Om <bi...@gmail.com> wrote:
>> 
>>> Here is an excellent primer comparing the commands available in Git 
>>> for their equivalent SVN functionalities.
>>> 
>>> http://git.or.cz/course/svn.html
>>> 
>>> I strongly suggest everyone go through this document in its entirety.
>>> 
>> 


Re: Git basics for SVN users

Posted by Dasa Paddock <dp...@esri.com>.
There are 5 ways listed here to specify the contents of a commit:
http://git-scm.com/docs/git-commit

Options 3 and 4 do not use the index/stage:

	• by listing files as arguments to the commit command, in which case the commit will ignore changes staged in the index, and instead record the current content of the listed files (which must already be known to git);

	• by using the -a switch with the commit command to automatically "add" changes from all known files (i.e. all files that are already listed in the index) and to automatically "rm" files in the index that have been removed from the working tree, and then perform the actual commit;"

--Dasa

On Mar 19, 2013, at 5:28 PM, Om <bi...@gmail.com>
 wrote:

> On Tue, Mar 19, 2013 at 5:06 PM, Gordon Smith <go...@adobe.com> wrote:
> 
>> In discussing 'git add', 'git rm', and 'git mv', this document says "So,
>> just like in SVN, you need to tell Git when you add, move or remove any
>> files." It makes it sound like these work the same way in Git and in SVN.
> 
> In fact, don't I have to use 'git add' after I have simply edited an
>> existing file? That's quite different from SVN where I can just edit and
>> commit. (What could be simpler?)
>> 
> 
> No you dont have to do  'git add' after an edit.  Where in the document
> does it say that?  Edit and commit just the same way in git as well.
> 
> 
>> 
>> That makes me wonder how accurate this document is elsewhere.
>> 
>> - Gordon
>> 
>> -----Original Message-----
>> From: omuppi1@gmail.com [mailto:omuppi1@gmail.com] On Behalf Of Om
>> Sent: Tuesday, March 19, 2013 4:39 PM
>> To: dev@flex.apache.org
>> Subject: Re: Git basics for SVN users
>> 
>> Of course, as the page says, the most current version of this primer course
>> has been moved here: http://git-scm.com/course/svn.html   Please use this
>> link instead.
>> 
>> Thanks,
>> Om
>> 
>> On Tue, Mar 19, 2013 at 4:33 PM, Om <bi...@gmail.com> wrote:
>> 
>>> Here is an excellent primer comparing the commands available in Git
>>> for their equivalent SVN functionalities.
>>> 
>>> http://git.or.cz/course/svn.html
>>> 
>>> I strongly suggest everyone go through this document in its entirety.
>>> 
>> 


Re: Git basics for SVN users

Posted by Om <bi...@gmail.com>.
On Tue, Mar 19, 2013 at 5:06 PM, Gordon Smith <go...@adobe.com> wrote:

> In discussing 'git add', 'git rm', and 'git mv', this document says "So,
> just like in SVN, you need to tell Git when you add, move or remove any
> files." It makes it sound like these work the same way in Git and in SVN.

 In fact, don't I have to use 'git add' after I have simply edited an
> existing file? That's quite different from SVN where I can just edit and
> commit. (What could be simpler?)
>

No you dont have to do  'git add' after an edit.  Where in the document
does it say that?  Edit and commit just the same way in git as well.


>
> That makes me wonder how accurate this document is elsewhere.
>
> - Gordon
>
> -----Original Message-----
> From: omuppi1@gmail.com [mailto:omuppi1@gmail.com] On Behalf Of Om
> Sent: Tuesday, March 19, 2013 4:39 PM
> To: dev@flex.apache.org
> Subject: Re: Git basics for SVN users
>
> Of course, as the page says, the most current version of this primer course
> has been moved here: http://git-scm.com/course/svn.html   Please use this
> link instead.
>
> Thanks,
> Om
>
> On Tue, Mar 19, 2013 at 4:33 PM, Om <bi...@gmail.com> wrote:
>
> > Here is an excellent primer comparing the commands available in Git
> > for their equivalent SVN functionalities.
> >
> > http://git.or.cz/course/svn.html
> >
> > I strongly suggest everyone go through this document in its entirety.
> >
>

RE: Git basics for SVN users

Posted by Gordon Smith <go...@adobe.com>.
In discussing 'git add', 'git rm', and 'git mv', this document says "So, just like in SVN, you need to tell Git when you add, move or remove any files." It makes it sound like these work the same way in Git and in SVN.

In fact, don't I have to use 'git add' after I have simply edited an existing file? That's quite different from SVN where I can just edit and commit. (What could be simpler?)

That makes me wonder how accurate this document is elsewhere.

- Gordon

-----Original Message-----
From: omuppi1@gmail.com [mailto:omuppi1@gmail.com] On Behalf Of Om
Sent: Tuesday, March 19, 2013 4:39 PM
To: dev@flex.apache.org
Subject: Re: Git basics for SVN users

Of course, as the page says, the most current version of this primer course
has been moved here: http://git-scm.com/course/svn.html   Please use this
link instead.

Thanks,
Om

On Tue, Mar 19, 2013 at 4:33 PM, Om <bi...@gmail.com> wrote:

> Here is an excellent primer comparing the commands available in Git 
> for their equivalent SVN functionalities.
>
> http://git.or.cz/course/svn.html
>
> I strongly suggest everyone go through this document in its entirety.
>

Re: Git basics for SVN users

Posted by Om <bi...@gmail.com>.
Of course, as the page says, the most current version of this primer course
has been moved here: http://git-scm.com/course/svn.html   Please use this
link instead.

Thanks,
Om

On Tue, Mar 19, 2013 at 4:33 PM, Om <bi...@gmail.com> wrote:

> Here is an excellent primer comparing the commands available in Git for
> their equivalent SVN functionalities.
>
> http://git.or.cz/course/svn.html
>
> I strongly suggest everyone go through this document in its entirety.
>