Documente Academic
Documente Profesional
Documente Cultură
Workflow
Staging Area
Staging Area
Setup
Create A Project
#
# # no changes added to commit (use git add and/or git commit a) modified: hello.c
Add Changes
$ $ # # # # # # git add hello.c git status On branch master Changes to be committed: (use git reset HEAD <file>... to unstage) modified: hello.c
By separating staging and committing, you have the ability to fine tune what goes into each commit.
Committing Changes
When weve used git commit, weve always included the -m flag that gave a comment on the command line. What if we omit the -m flag?
Committing Changes
Committing Changes
git will pop you into the editor of your choice. The editor is chosen from the following list (in priority order): GIT_EDITOR environment variable core.editor configuration setting VISUAL environment variable EDITOR environment variable
Committing Changes
$ git status # On branch master nothing to commit (working directory clean)
Creating a Branch
$ git checkout -b my_branch # ^ Creates a new branch my_branch, and checks it out (switches to that branch) $ git status # Should say something about being on the my_branch branch
Merging
$ git checkout my_branch $ git merge master
Sources
gitimmersion.com gitref.org