[Freemint-list] Where is my commit?

Vincent Rivière vincent.riviere at freesbee.fr
Sat Jan 28 14:24:46 MSK 2017


On 28/01/2017 à 11:54, Helmut Karlowski wrote:
> Wanted to try the new git-repository:
>
> $git commit -F ~/commits/my-freemint/xaaes/src.km/example.cnf example.cnf
> [helmut-enhancements 6ce7a64] add description for standard_font_point
>   1 file changed, 7 insertions(+)
>
> But there are no changes staged at:
>
> https://github.com/freemint/freemint/commits/helmut-enhancements/xaaes/src.km

There are multiple mistakes.
Fortunately, solution is easy :-)

Mistakes:
"commit" works only locally. Then you have to "push" your work to GitHub.
-F is the message file, not the file to commit

Solutions:

First, if not done already, I urge you to do the following configuration 
commands, just once:

git config --global user.name "Helmut Karlowski"
git config --global user.email "helmut.karlowski at ish.de"

The above information is important, as it will be stored inside your commits.

Enable new push mode:
git config --global push.default simple
# This will avoid questions when doing git push

In most cases, I strongly advise to use Git GUI to make commits. It has nice 
UI, and after you get the right habits, it is very efficient.

Alternative: using the command line
Here is the right sequence:

# See the files you have messed locally
git status

# See your actual changes
git diff
# The diff output is normally colored. If it is not, please complain.

# Prepare (= "stage") your files for commit
git add . # to add all your changes
git add only_this_file

# At this time, it does not hurt to see what you are going to commit
git diff --cached

# Commit locally
git commit -m 'My commit message'

# See what you just have committed locally
git show

# Publish (= "push") your changes to GitHub
git push

# See local and remote history
git log --oneline --decorate --graph --all

-- 
Vincent Rivière


More information about the Freemint-list mailing list