Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Committing changes to GitHub, what am I doing wrong?

30 views
Skip to first unread message

Alf P. Steinbach

unread,
Jan 5, 2016, 7:09:27 AM1/5/16
to
A bit off-topic, but, since clc++ never had a charter I feel safe, ;-)

I finally got cppx to compile with MinGW g++ (next step is adding
Unicode console i/o support for g++), but when I tried to commit to
GitHub the "GitHub" GUI thingy didn't seem to present all changes and
new files.

Sure enough, after committing it listed like 30 new changes, which I
then had to commit again.

And after that, a single remaining change that I had to commit.

Surely it's not meant to work like that, incremental commits?

I haven't used Git earlier so it's all new to me, including that I
haven't the foggiest idea what the difference is between committing and
pushing changes (sync) to GitHub.


Cheers & thanks for not biting me now,

- Alf

https://github.com/alf-p-steinbach/cppx/commits/plutonium

Christian Gollwitzer

unread,
Jan 5, 2016, 7:44:34 AM1/5/16
to
Am 05.01.16 um 13:08 schrieb Alf P. Steinbach:
> A bit off-topic, but, since clc++ never had a charter I feel safe, ;-)
>
> Sure enough, after committing it listed like 30 new changes, which I
> then had to commit again.
>
> And after that, a single remaining change that I had to commit.
>
> Surely it's not meant to work like that, incremental commits?
>
> I haven't used Git earlier so it's all new to me, including that I
> haven't the foggiest idea what the difference is between committing and
> pushing changes (sync) to GitHub.

Are you talking about some GUI from GitHub? I've only ever used pure git
from the commandline, where it works like this

1) git commit -a
This opens up an editor with an overview of the changes, you enter a
description to cimmit your changes. These are then stored locally only
(in the .git folder)

2) git push
send all commits to the server (github, in that case), i.e. publish them.

If you have new files, you need to "git add" them, to be included in the
commit. If you leave off the "-a" from the commit, it only includes
changes in the files which you explicitly "added" to the commit. The -a
adds all files that are already under version control.

"git pull" is the opposite of "push" and it updates your local copy with
the changes from the server. As opposed to a centralized VCS like CVS or
SVN, you do not need to push everything to the server - you can happily
commit to your local repo, and once you think it is working as desired,
you "push" it to the server. The more professional users like the kernel
developers also perform a rebase operation, which allows you to bundle
several commits into one before you publish the changes. Personally, I
do not do this, I publish every typo correction.

Christian

Christian Gollwitzer

unread,
Jan 5, 2016, 7:46:39 AM1/5/16
to
Am 05.01.16 um 13:44 schrieb Christian Gollwitzer:
> Am 05.01.16 um 13:08 schrieb Alf P. Steinbach:
>> I haven't used Git earlier so it's all new to me, including that I
>> haven't the foggiest idea what the difference is between committing and
>> pushing changes (sync) to GitHub.
>
> Are you talking about some GUI from GitHub? I've only ever used pure git
> from the commandline, where it works like this

PS: On Windows, I've used TortoiseSVN in the past, which nicely
integrates with the explorer. Maybe you try TortoiseGIT?

Christian

Darko Miletic

unread,
Jan 5, 2016, 7:57:04 AM1/5/16
to
On 05/01/16 09:08, Alf P. Steinbach wrote:
> A bit off-topic, but, since clc++ never had a charter I feel safe, ;-)
>
> I finally got cppx to compile with MinGW g++ (next step is adding
> Unicode console i/o support for g++), but when I tried to commit to
> GitHub the "GitHub" GUI thingy didn't seem to present all changes and
> new files.
>
> Sure enough, after committing it listed like 30 new changes, which I
> then had to commit again.
>
> And after that, a single remaining change that I had to commit.
>
> Surely it's not meant to work like that, incremental commits?

In general it should not behave like that. In any case the best results
are obtained by using command line git client. There you have the full
control over everything and it mostly works once configured.

For example let us assume you have your project in foo dir.
Open the command line, position yourself in that dir. Execute:
git add -A
git commit -m "My latest changes"
git push origin mybranchname

That's it. All this assumes that your git is properly configured, that
you have github keys in place, that your .gitignore is correct etc.

What does that mean? It means:
* Install git client - https://git-scm.com/download/win (for windows)
* configure git client
from command line execute:
git config --global user.name "Your Name"
git config --global user.email your...@domain.tld
git config --global core.filemode false
git config --global core.autocrlf false
git config --global color.ui true
git config --global merge.renamelimit 10000
git config --global push.default simple

* generate and configure github ssh keys
https://help.github.com/articles/generating-ssh-keys/

However if you are into gui for vcs than check this one out -
https://tortoisegit.org/






Öö Tiib

unread,
Jan 5, 2016, 8:24:12 AM1/5/16
to
The TortoiseSVN and TortoiseHG are fine but TortoiseGit was screwing everything
up badly last I tried. Command line is ok and Atlassian SourceTree and SmartGit
seemed at least working and helpful unlike that TortoiseGit.

Jorgen Grahn

unread,
Jan 5, 2016, 9:14:12 AM1/5/16
to
On Tue, 2016-01-05, Christian Gollwitzer wrote:
> Am 05.01.16 um 13:08 schrieb Alf P. Steinbach:
>> A bit off-topic, but, since clc++ never had a charter I feel safe, ;-)
>>
>> Sure enough, after committing it listed like 30 new changes, which I
>> then had to commit again.
>>
>> And after that, a single remaining change that I had to commit.
>>
>> Surely it's not meant to work like that, incremental commits?
>>
>> I haven't used Git earlier so it's all new to me, including that I
>> haven't the foggiest idea what the difference is between committing and
>> pushing changes (sync) to GitHub.
>
> Are you talking about some GUI from GitHub? I've only ever used pure git
> from the commandline, where it works like this

Fortunately, a Git repo at GitHub works just like any other Git repo.
It's plausible that there's a GUI there where you can mess up in
interesting ways, but if so, there's no need to use it.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

Jorgen Grahn

unread,
Jan 5, 2016, 12:37:35 PM1/5/16
to
On Tue, 2016-01-05, Christian Gollwitzer wrote:
> Am 05.01.16 um 13:08 schrieb Alf P. Steinbach:
>> A bit off-topic, but, since clc++ never had a charter I feel safe, ;-)
>>
>> Sure enough, after committing it listed like 30 new changes, which I
>> then had to commit again.
>>
>> And after that, a single remaining change that I had to commit.
>>
>> Surely it's not meant to work like that, incremental commits?
>>
>> I haven't used Git earlier so it's all new to me, including that I
>> haven't the foggiest idea what the difference is between committing and
>> pushing changes (sync) to GitHub.
>
> Are you talking about some GUI from GitHub? I've only ever used pure git
> from the commandline, where it works like this
>
> 1) git commit -a
> This opens up an editor with an overview of the changes, you enter a
> description to cimmit your changes. These are then stored locally only
> (in the .git folder)

Note that that's just one of many ways of producing commits.

> 2) git push
> send all commits to the server (github, in that case), i.e. publish them.

Well ...

The more general form is 'git push <remote> <my_commit>:<your_branch>',
so 'git push github master:master' means:

"Dear github, please take your "master" branch and make it so
that its tip becomes my commit called "master". You may steal
as many commits from me as you need. And if you refuse because
doing it would mean something more disruptive than just adding a
string of commits on top of your present "master", that's ok
too; I'll survive (and perhaps add a --force next time)."

> If you have new files, you need to "git add" them, to be included in the
> commit. If you leave off the "-a" from the commit, it only includes
> changes in the files which you explicitly "added" to the commit. The -a
> adds all files that are already under version control.
>
> "git pull" is the opposite of "push" and it updates your local copy with
> the changes from the server. As opposed to a centralized VCS like CVS or
> SVN, you do not need to push everything to the server - you can happily
> commit to your local repo, and once you think it is working as desired,

And once you see it's split into commits in a nice and logical way.
You can do pretty much anything to the commits as long as they're unpublished,
using e.g. rebase -i.

> you "push" it to the server. The more professional users like the kernel
> developers also perform a rebase operation, which allows you to bundle
> several commits into one before you publish the changes. Personally, I
> do not do this, I publish every typo correction.

YMMV, but that's one of the best things about Git. You don't have to
be professional to appreciate that -- just perhaps a bit more
interested in the history than the average person.

Chris Vine

unread,
Jan 5, 2016, 2:44:25 PM1/5/16
to
On Tue, 5 Jan 2016 13:08:58 +0100
"Alf P. Steinbach" <alf.p.stein...@gmail.com> wrote:
> A bit off-topic, but, since clc++ never had a charter I feel safe, ;-)
>
> I finally got cppx to compile with MinGW g++ (next step is adding
> Unicode console i/o support for g++), but when I tried to commit to
> GitHub the "GitHub" GUI thingy didn't seem to present all changes and
> new files.
>
> Sure enough, after committing it listed like 30 new changes, which I
> then had to commit again.
>
> And after that, a single remaining change that I had to commit.
>
> Surely it's not meant to work like that, incremental commits?
>
> I haven't used Git earlier so it's all new to me, including that I
> haven't the foggiest idea what the difference is between committing
> and pushing changes (sync) to GitHub.

git seems to be available as a windows binary so I would strongly
suggest that you use that.

git is a distributed system. 'commit' commits to your local
repository. 'push' pushes the changes you have committed locally to
another repository that you happen to have chosen to commit to (or have
set as your remote repository). pushing may or may not succeed. It
should succeed if you are the only one pushing to the remote repository,
unless something else has gone adrift.

Chris

Chris Vine

unread,
Jan 5, 2016, 2:50:45 PM1/5/16
to
On Tue, 5 Jan 2016 19:43:46 +0000
Chris Vine <chris@cvine--nospam--.freeserve.co.uk> wrote:
> On Tue, 5 Jan 2016 13:08:58 +0100
> git is a distributed system. 'commit' commits to your local
> repository. 'push' pushes the changes you have committed locally to
> another repository that you happen to have chosen to commit to (or
^^^^^^
push
Chris


0 new messages