Creating and using the GIT

 

1. Create a git

 

 

 2. Use

 

git init

     Create a local repo, enter a project directory, execute git init, it will initialize a repo, and create a .git folder in the current folder.

 

git status

     Query repo state.
     git status -s: -s indicates short, -s output flag will be two, a first column for staging area, a second column for working directory.

 

git add file

     Before submitting, Git has a staging area (staging area), can be placed in the newly added files or adding new changes. Changes submitted at the last commit is added to the staging area in the changes, rather than on our disk change.

git add .    

Recursively add all files in the current working directory.

 

 

git commit

     Add submission has been coming changes.

git commit -m “the commit message"

      Creating commit

git commit -a

      Will first of all have track changes to files add in,
      Then submit (a bit like the svn commit, without first staging). For there is no track of files, or need to git add it.
git commit --amend
    Added submitted. Will use the parent submit the same to the current node for a new submission, the old submission will be canceled.
 
 
 
 

Guess you like

Origin www.cnblogs.com/Rivend/p/12001444.html