simple git question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

simple git question

Christophe Battarel

hello again,

a more easy question but i am struggling with it often and did not find the answer on the net :

i have a local git repo based on my github fork; how can i pull new created branch (10.0 for instance) without putting the mess in my repo ?

Best regards

Christophe


_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
Reply | Threaded
Open this post in threaded view
|

Re: simple git question

Jean Traullé


Le 11 juil. 2019 à 11:13, Christophe Battarel <[hidden email]> a écrit :

hello again,

a more easy question but i am struggling with it often and did not find the answer on the net :

i have a local git repo based on my github fork; how can i pull new created branch (10.0 for instance) without putting the mess in my repo ?

Best regards

Christophe

Hello,

In your local Git repository (your Fork), you can add the remote upstream Github repo like this :
git remote add upstream https://github.com/Dolibarr/dolibarr
Next, you just need to use fetch 
git fetch upstream
Finally, use git merge to merge a specific branch into your local branch.


BR,
Jean


_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

attachment0 (2K) Download Attachment
attachment1 (2K) Download Attachment
signature.asc (275 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: simple git question

Yves Brungard
In reply to this post by Christophe Battarel
Bonjour,
J'ai ça en stock:
Amicalement
Yves
Le 11/07/2019 à 11:13, Christophe Battarel a écrit :

hello again,

a more easy question but i am struggling with it often and did not find the answer on the net :

i have a local git repo based on my github fork; how can i pull new created branch (10.0 for instance) without putting the mess in my repo ?

Best regards

Christophe


_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev



_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
Reply | Threaded
Open this post in threaded view
|

Re: simple git question

Christophe Battarel

i should be more accurate :

1) i have a fork on github based on dolibarr github repo

2) i have a local repo linked with my fork

3) i often do git pull from dolibarr (not my fork) github repo to get latest code, then i push on my github fork

4) this way i can make commit on my local repo, push on my github fork, and make PR on dolibarr official repo.


My question is : when a new branch is created on dolibarr official repo (latest was 10.0), how do i get it in my local and my fork repos ?

i guess other dolibarr contributors should face the same "problem" (for me)...


Thanks

Christophe


Le 11/07/2019 à 11:30, Yves Brungard a écrit :
Bonjour,
J'ai ça en stock:
Amicalement
Yves
Le 11/07/2019 à 11:13, Christophe Battarel a écrit :

hello again,

a more easy question but i am struggling with it often and did not find the answer on the net :

i have a local git repo based on my github fork; how can i pull new created branch (10.0 for instance) without putting the mess in my repo ?

Best regards

Christophe


_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev



_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
Reply | Threaded
Open this post in threaded view
|

Re: simple git question

Sasa Ostrouska
On Thu, Jul 11, 2019 at 12:42 PM Christophe Battarel
<[hidden email]> wrote:

>
> i should be more accurate :
>
> 1) i have a fork on github based on dolibarr github repo
>
> 2) i have a local repo linked with my fork
>
> 3) i often do git pull from dolibarr (not my fork) github repo to get latest code, then i push on my github fork
>
> 4) this way i can make commit on my local repo, push on my github fork, and make PR on dolibarr official repo.
>
>
> My question is : when a new branch is created on dolibarr official repo (latest was 10.0), how do i get it in my local and my fork repos ?
>
"git fetch " should do the job for everything. Then you have to use
"git merge" to merge what you need and where you need it.

man git fetch

Rgds
Saxa

> i guess other dolibarr contributors should face the same "problem" (for me)...
>
>
> Thanks
>
> Christophe
>
>

_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
Reply | Threaded
Open this post in threaded view
|

Re: simple git question

Christophe Battarel

do you have an example ?

Le 11/07/2019 à 12:40, Sasa Ostrouska a écrit :
On Thu, Jul 11, 2019 at 12:42 PM Christophe Battarel
[hidden email] wrote:
i should be more accurate :

1) i have a fork on github based on dolibarr github repo

2) i have a local repo linked with my fork

3) i often do git pull from dolibarr (not my fork) github repo to get latest code, then i push on my github fork

4) this way i can make commit on my local repo, push on my github fork, and make PR on dolibarr official repo.


My question is : when a new branch is created on dolibarr official repo (latest was 10.0), how do i get it in my local and my fork repos ?

"git fetch " should do the job for everything. Then you have to use
"git merge" to merge what you need and where you need it.

man git fetch

Rgds
Saxa

i guess other dolibarr contributors should face the same "problem" (for me)...


Thanks

Christophe


_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev


_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
Reply | Threaded
Open this post in threaded view
|

Re: simple git question

Christophe Battarel

i answer myself, it can help others :

in my case, i have two remotes origin (which is my fork on github) and dolibarr (official dolibarr repo).

in order to retrieve a branch, let's take 10.0, you have to :

1) git fetch dolibarr

2) git checkout -t dolibarr/10.0

that's all !


Le 11/07/2019 à 15:45, Christophe Battarel a écrit :

do you have an example ?

Le 11/07/2019 à 12:40, Sasa Ostrouska a écrit :
On Thu, Jul 11, 2019 at 12:42 PM Christophe Battarel
[hidden email] wrote:
i should be more accurate :

1) i have a fork on github based on dolibarr github repo

2) i have a local repo linked with my fork

3) i often do git pull from dolibarr (not my fork) github repo to get latest code, then i push on my github fork

4) this way i can make commit on my local repo, push on my github fork, and make PR on dolibarr official repo.


My question is : when a new branch is created on dolibarr official repo (latest was 10.0), how do i get it in my local and my fork repos ?

"git fetch " should do the job for everything. Then you have to use
"git merge" to merge what you need and where you need it.

man git fetch

Rgds
Saxa

i guess other dolibarr contributors should face the same "problem" (for me)...


Thanks

Christophe


_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev


_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
Reply | Threaded
Open this post in threaded view
|

Re: simple git question

Sasa Ostrouska
On Thu, Jul 11, 2019 at 4:30 PM Christophe Battarel
<[hidden email]> wrote:

>
> i answer myself, it can help others :
>
> in my case, i have two remotes origin (which is my fork on github) and dolibarr (official dolibarr repo).
>
> in order to retrieve a branch, let's take 10.0, you have to :
>
> 1) git fetch dolibarr
>
> 2) git checkout -t dolibarr/10.0
>
> that's all !
>
>
> Le 11/07/2019 à 15:45, Christophe Battarel a écrit :
>
> do you have an example ?
>
Hi, yes it is basically as you same answer it. I use it to track my
install of dolibarr. I did a git pull initially and then git checkout
branch I want
to follow.
then from time to time I do a git fetch and it updates the full
dolibarr tree, but until I do git merge I do not get the branch I
follow merged into the
currently used one.
This permits me to have all the time the develop branch and other
branches up to date, after a new release is out, I just do git
checkout release
and have that release ready for use.
Of course there is other steps like restarning dolibarr install
process etc. to make it work fully.

In your case git fetch does all what you need, it fetches all the
blobs to your local dir.

Rgds
Saxa

> Le 11/07/2019 à 12:40, Sasa Ostrouska a écrit :
>
> On Thu, Jul 11, 2019 at 12:42 PM Christophe Battarel
> <[hidden email]> wrote:
>
> i should be more accurate :
>
> 1) i have a fork on github based on dolibarr github repo
>
> 2) i have a local repo linked with my fork
>
> 3) i often do git pull from dolibarr (not my fork) github repo to get latest code, then i push on my github fork
>
> 4) this way i can make commit on my local repo, push on my github fork, and make PR on dolibarr official repo.
>
>
> My question is : when a new branch is created on dolibarr official repo (latest was 10.0), how do i get it in my local and my fork repos ?
>
> "git fetch " should do the job for everything. Then you have to use
> "git merge" to merge what you need and where you need it.
>
> man git fetch
>
> Rgds
> Saxa
>
> i guess other dolibarr contributors should face the same "problem" (for me)...
>
>
> Thanks
>
> Christophe
>
>
> _______________________________________________
> Dolibarr-dev mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
>
>
> _______________________________________________
> Dolibarr-dev mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
>
> _______________________________________________
> Dolibarr-dev mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev