* Re: howto to sqash files only on remote repo ?
2015-09-17 7:21 howto to sqash files only on remote repo ? Pierre Bourgin
@ 2015-09-19 0:29 ` Pierre Bourgin
2015-09-19 2:41 ` Steve Prybylx
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Pierre Bourgin @ 2015-09-19 0:29 UTC (permalink / raw)
To: voidlinux
[-- Attachment #1.1: Type: text/plain, Size: 513 bytes --]
I feel alone with this problem, probably because I missunderstood something
the way git works !
So far, the only workaround I see is to use an intermediate local branch to
perform the rebase/squash stuff:
- branch local/mybranch.local :
keep all my (internal) history
- branch local/mybranch :
will receive a merge from mybranch.local
then perform a rebase/squash on it
then push it onto my github/mybranh (public repo)
- branch github/mybranch:
ready to be used for pull request to void-packages.
Pierre
[-- Attachment #1.2: Type: text/html, Size: 577 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: howto to sqash files only on remote repo ?
2015-09-17 7:21 howto to sqash files only on remote repo ? Pierre Bourgin
2015-09-19 0:29 ` Pierre Bourgin
@ 2015-09-19 2:41 ` Steve Prybylx
2015-09-19 3:19 ` Steve Prybylx
2015-09-19 19:40 ` Stefan Mühlinghaus
3 siblings, 0 replies; 5+ messages in thread
From: Steve Prybylx @ 2015-09-19 2:41 UTC (permalink / raw)
To: voidlinux
[-- Attachment #1.1: Type: text/plain, Size: 1623 bytes --]
I usually keep my master branch clean and only use it for pulling from
upstream.
> git pull upstream master
When I want to, for example, contribute a new package, I will create a new
branch from master. I usually name it after the package I'm creating. So,
From my master branch:
> git checkout -b newpkg
If some time has passed since I've started, A day or two:
> $ git pull --rebase upstream master
When I think my package is ready for a pull request:
> git commit -m "New package: newpkg-version
git push -u origin newpkg
If there are errors, fix them and then:
> git commit --amend
git push -f
Anyways, this is my usual workflow. Hope this helps!
On Thursday, September 17, 2015 at 3:21:28 AM UTC-4, Pierre Bourgin wrote:
>
> Hello there,
>
> I'm newbie with git.
> I try to pull requests to void-packages (offer new packages) in a nice way
> for the rewiever, ie with only one changeset.
>
> So I carefully read the usefull doc of PullMoll about git :
>
> https://github.com/voidlinux/documentation/wiki/How-to-use-git,-by-@pullmoll
>
> My question: Is there a chance to keep the distinct commits (several) in
> my local repo, but combine them into a single changeset in my remote github
> repo ("origin") ?
>
> I used "git rebase -i" on my local repo (squash) then push to remote.
> So remote repo will contains a single changeset as expected ...
> And there is only ONE changeset too in my local repo, since the "rebase"
> happens on my local repo first.
>
> I've read various doc, but did not find anyhting like "git push --rebase"
> for instance.
>
> Any clue ?
>
> Thanks - Pierre
>
[-- Attachment #1.2: Type: text/html, Size: 3860 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: howto to sqash files only on remote repo ?
2015-09-17 7:21 howto to sqash files only on remote repo ? Pierre Bourgin
2015-09-19 0:29 ` Pierre Bourgin
2015-09-19 2:41 ` Steve Prybylx
@ 2015-09-19 3:19 ` Steve Prybylx
2015-09-19 19:40 ` Stefan Mühlinghaus
3 siblings, 0 replies; 5+ messages in thread
From: Steve Prybylx @ 2015-09-19 3:19 UTC (permalink / raw)
To: voidlinux
[-- Attachment #1.1: Type: text/plain, Size: 1578 bytes --]
I forgot an important step in there:
> git add srcpkgs/newpkg/
before the
> git commit -m "New package: newpkg-version"
If your a complete newbie at git and your just making minor changes for a
new package, I would probably suggest just using:
> git commit --amend
After each change.
But, to answer your question about "squashing" some commits, You may want
to try:
> git log
To find the hash of the "New package: newpkg" commit. We'll say it's
'1234567...' (usually you just need the first 7 characters)
> git reset 1234567
That will reset 'HEAD', Then:
> git add srcpkgs/newpkg/
git commit --amend
On Thursday, September 17, 2015 at 3:21:28 AM UTC-4, Pierre Bourgin wrote:
>
> Hello there,
>
> I'm newbie with git.
> I try to pull requests to void-packages (offer new packages) in a nice way
> for the rewiever, ie with only one changeset.
>
> So I carefully read the usefull doc of PullMoll about git :
>
> https://github.com/voidlinux/documentation/wiki/How-to-use-git,-by-@pullmoll
>
> My question: Is there a chance to keep the distinct commits (several) in
> my local repo, but combine them into a single changeset in my remote github
> repo ("origin") ?
>
> I used "git rebase -i" on my local repo (squash) then push to remote.
> So remote repo will contains a single changeset as expected ...
> And there is only ONE changeset too in my local repo, since the "rebase"
> happens on my local repo first.
>
> I've read various doc, but did not find anyhting like "git push --rebase"
> for instance.
>
> Any clue ?
>
> Thanks - Pierre
>
[-- Attachment #1.2: Type: text/html, Size: 3877 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: howto to sqash files only on remote repo ?
2015-09-17 7:21 howto to sqash files only on remote repo ? Pierre Bourgin
` (2 preceding siblings ...)
2015-09-19 3:19 ` Steve Prybylx
@ 2015-09-19 19:40 ` Stefan Mühlinghaus
3 siblings, 0 replies; 5+ messages in thread
From: Stefan Mühlinghaus @ 2015-09-19 19:40 UTC (permalink / raw)
To: voidlinux
[-- Attachment #1.1: Type: text/plain, Size: 380 bytes --]
I am not an expert git user myself, but as far as I know using a new local
branch with the squashed commits is the only feasable way to preserve your
complete commit history. There may be other ways which would probably be
even more tricky to use.
Having a local and remote branch that differ in commits and are not
supposed to be merged is simply not inteded git behaviour.
[-- Attachment #1.2: Type: text/html, Size: 420 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread