Introduction to Git (3) -Committing ChangessteemCreated with Sketch.

in #python-dev4 years ago

Committing Changes

When you commit changes, you are telling Git to make a snapshot of this state in the repo. Do that now by using the git commit command. The -m option tells Git to use the commit message that follows. If you don’t use -m, Git will bring up an editor for you to create the commit message. In general, you want your commit messages to reflect what has changed in the commit:

$ git commit -m "creating hello.py"
[master (root-commit) 25b09b9] creating hello.py
 1 file changed, 3 insertions(+)
 create mode 100755 hello.py

$ git status
On branch master
nothing to commit, working directory clean

You can see that the commit command returned a bunch of information, most of which isn’t that useful, but it does tell you that only 1 file changed (which makes sense as we added one file). It also tells you the SHA of the commit (25b09b9). We’ll have an aside about SHA a bit later.

Running the git status command again shows that we have a clean working directory, meaning that all changes are committed to Git.

At this point, we need to stop our tutorial and have a quick chat about the staging area.

Sort:  

your previous post on pythonanywhere to create a website with registration seriers looks good, are you going to con tinue?

Coin Marketplace

STEEM 0.27
TRX 0.13
JST 0.031
BTC 61745.50
ETH 2898.66
USDT 1.00
SBD 3.61