Jump to content



Photo
- - - - -

Working with Git


This topic has been archived. This means that you cannot reply to this topic.
9 replies to this topic

#1   Gergely

Gergely

    Action Hero

  • Community Team
  • 1,256 posts

Posted 18 February 2012 - 06:46

Hi Harald,

it looks like good. How can we test it? Sorry if I am lame, but would be appreciated more github tutorials for social works. There are a lot of questions of GIT and we can't coorporate with the projects. I hope you like more free developers contacts of BSD licence.

Regards,
Gergely

some rewrites :-


#2   foxp2

foxp2

    strong as a Twig

  • Banned
  • 310 posts

Posted 18 February 2012 - 08:16

Hi Harald,

it looks like good. How can we test it? Sorry if I am lame, but would be appreciated more github tutorials for social works. There are a lot of questions of GIT and we can't coorporate with the projects. I hope you like more free developers contacts of BSD licence.

Regards,
Gergely


Hi @Gergely

i get several repo on github.
for oscommerce france, this is my config :

[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:oscommerce-france/oscommerce.git
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "cfg"]
remote = origin
merge = refs/heads/origin
[remote "foxp2"]
url = git://github.com/foxp2/oscommerce.git
fetch = +refs/heads/*:refs/remotes/foxp2/*

the osCommerce (team FR) is a fork of FoxP2 osCommerce, itself a fork of HaraldPDL, itself a fork of osCommerce <- original repo

major command line :
i update repo france :
- git fetch foxp2 (https://github.com/f...mmerce/branches 4 active branches but only cfg is concerned by changes )
- git pull foxp2 cfg (download on local drive)
- git push origin (update our repo)

to work with branch (local)
- git checkout cfg

I hope that answers your question.

Regards

Edited by foxp2, 18 February 2012 - 08:20.

-------------------

#3   Gergely

Gergely

    Action Hero

  • Community Team
  • 1,256 posts

Posted 18 February 2012 - 09:47

Merci beaucoup Laurent,

this is very usefull information. I am translating some important things now from the git books for our freinds.

But more cheets need.

First is typical problem:

- How can we copy a commit from git@github.com:oscommerce-france/oscommerce.git repo branch to our hungarian fetched branch keep original commiter data? We fork oscommerce of course but not france repo. (When we are in paralell branches)


I dont find the solution.but this is possible.


And I will have more questions /shifty.gif' class='bbc_emoticon' alt=':shifty:' />


Regards,
Gergely

some rewrites :-


#4   foxp2

foxp2

    strong as a Twig

  • Banned
  • 310 posts

Posted 18 February 2012 - 10:09

harald, i'm sorry, i realise that I have polluting your subject ! /sick.gif' class='bbc_emoticon' alt=':x' />
could you split posts about git in a new thread ? /blush.png' class='bbc_emoticon' alt=':blush:' />
-------------------

#5   Harald Ponce de Leon

Harald Ponce de Leon

    Healthy Giraffe

  • Core Team
  • 4,893 posts

Posted 18 February 2012 - 14:36

Hi All..

It is also possible to select certain commits to merge from Github. From your forked repository, go to Network -> Fork Queue and there you will see all commits everyone has made from their forked repositories. These can each be selected to merge to your own repository.

This is known as cherry picking and is the same as using "git cherry-pick <commit sha>".

Unfortunately Github does not automatically detect which commits have already been merged (eg, by using "git cherry-pick") and can be selected to be ignored.

When using the Fork Queue at Github to merge commits, you must also perform a "git pull" from your local repository to download the changes.

Hope that helps!

Kind regards,
Harald Ponce de Leon

#6   foxp2

foxp2

    strong as a Twig

  • Banned
  • 310 posts

Posted 18 February 2012 - 15:20

Hi,
@Harald Ponce de Leon
Thanks for this tip. /thumbsup.gif' class='bbc_emoticon' alt=':thumbsup:' />

@Gergely

our hungarian fetched branch

Is this the one : https://github.com/tgely/oscommerce ? /huh.png' class='bbc_emoticon' alt=':huh:' />
-------------------

#7   foxp2

foxp2

    strong as a Twig

  • Banned
  • 310 posts

Posted 18 February 2012 - 17:56

@Gergely :

poc :

I've added tgely repo :

git remote add Tgely git://github.com/tgely/oscommerce.git


now, i have in my git config file :

[remote "Tgely"]
	url = git://github.com/tgely/oscommerce.git
	fetch = +refs/heads/*:refs/remotes/Tgely/*

afterward, I've selected a specific commit ( icon labels for customers : https://github.com/t...1ac76688c9f4059 ) :

git cherry-pick 07481502fd


a simple check :

git status


your branch is ahead of 'origin/master' by 1 commit

git push origin


the selected commit is now on my repo : https://github.com/f...ae9f4d619f12436
-------------------

#8   Gergely

Gergely

    Action Hero

  • Community Team
  • 1,256 posts

Posted 18 February 2012 - 19:32

Thank you!

This will be very usefull and I hope to push the main projects.

Edited by Gergely, 18 February 2012 - 19:33.

some rewrites :-


#9   Gergely

Gergely

    Action Hero

  • Community Team
  • 1,256 posts

Posted 09 March 2012 - 19:56

Hi all,

most of githubbers start working in main branch, but this is not effective. I took this when I was newbee /rolleyes.gif' class='bbc_emoticon' alt=':rolleyes:' /> too. I see now the Branches is more usefull in github works. If you are intrested in fixing or a subproject where you want to solve problems in many steps use sub-branch. Finaly you can merge all from it only in one commit to your main branch.

_x_____________________x____ (your main branch with last clean commit)
-- |__x__x_x_x___x___x____|
(sub-branch with confused works)


When you are working in a sub-branch project nobody wants to pick or merge your commits. After you finished it you can merge your confused works as a clean published commit.

You can take some information in the sub-branch step by step and finaly you can revert all non usefull infos before merging.


Some newbee gitthubbers start to merging hundreds and hundreds commits against to use one merge branch master. Note: github repo will be frozen after hundreds commits and need to change a new repo.


Regards,
Gergely

Edited by Gergely, 09 March 2012 - 19:57.

some rewrites :-


#10   Gergely

Gergely

    Action Hero

  • Community Team
  • 1,256 posts

Posted 11 March 2012 - 14:28

@ foxp2

I cherry-pick gindhal ec70ce836b nice commit to my repo. Gitbash was the winner.

Steps:

git remote add oscommerce-france git://github.com/oscommerce-france/oscommerce2.git


(Harald voice says)

git pull all (git gui)


git cherry-pick ec70ce836b
error: could not apply ec70ce8... Traduction des true/false de configuration de
l'admin (suggéré a HPDL)
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'


Resolve french.php conflict

git add -u


Resolve line end spaces in genereal.php

put 3 file changes only into commit

git commit -a


git push origin


Reagads,
Gergely

Edited by Gergely, 11 March 2012 - 14:32.

some rewrites :-