git commonly used commands for future reference

.Git a process for submission of documents
git add -> git commit -> git push

Staging area -> Local Warehouse -> remote repository

II. Common git command
1. Initialize command git repository

git init

2. Add users and mailboxes 

$  git config --global user.name "wumginxm"

$  git config --global user.email [email protected]

git add filename Add File

git commit -m 0.1 code base submitted

git pull to update the code

git push commit code

1. git checkout to restore the file name of the local file

   git checkout branch switching branch name

2. git diff compare workspace file and local file repository with no arguments, then

3. git merge b specify the name of a branch merge the current branch

4. git rebase b b merge into the current branch

5. git reset --hard revert to the previous version

6 .. git log to view the records submitted

7. git reset - hard 23ddnndnfdd to restore the specified version

8 git rm file name to delete the temporary file area

9..git branch -a view remote branch

10. git push origin master --force forcibly push replacing the original document to a remote server

11. git reflog show dev to see operational records git reset --hard version number to restore a specific version

eclipse configure git to ignore global submitted 

Click Open to open the file, write core and core following, the path to the local file path to ignore local rules of the path,

The main parameters excludesFiles, configure all ok after the completion
---------------------

# Download a project and its entire code history
$ git clone [url]


# Creating a new branch, and the branch switch to
git checkout -b [branch]

# View modified files
git status 

# Add all the files in the current directory to the staging area
 git add.

# Submitted to the staging area warehouse district
 git commit -m [message]

# Retrieve change remote repository, and merge with the local branch
$ git pull [remote] [branch ]

# Upload a local branch to a specified remote repository
 git push [remote] [branch]

# Delete branch
 git branch -d [branch-name]

# Delete remote branch
 git the Push Origin --delete [Branch-name]
 git Branch -dr [Remote / Branch]

# Temporarily change uncommitted removed, and then later moved into the
$ git stash
$ git stash POP
---------------------

Guess you like

Origin www.cnblogs.com/xdanny/p/11303168.html