git command

git branch View all local branches
git status View current status 
git commit Submit  git 
branch -a View all branches
git branch -r View all remote branches :ndshow git push origin master Push the file to the server  git remote show origin Display the resources in the origin of the remote library  git push origin master:develop git push origin master:hb-dev Associate the local library with the library on the server  git checkout --track origin/dev switch to remote dev branch git branch -D master develop delete local library develop git checkout -b dev create a new local branch dev git merge origin/dev merge branch dev with current branch git checkout dev switch Go to the local dev branch git remote show to view the remote library git add . git rm file name (including path) Delete the specified file from git














git clone git://github.com/schacon/grit.git pull the code down from the server
git config --list see all users
git ls-files see committed
git rm [file name] delete a file
git commit -a Commit all changes in the current repos
git add [file name] Add a file to git index
git commit -v When you use the -v parameter, you can see the difference in
commit git commit -m "This is the message describing the commit" Add commit information
git commit -a -a stands for add, add all changes to the git index and then commit
git commit -a -v General commit command
git log Look at the log of your commit
git diff Look at the ones that have not been temporarily stored Update
git rm aa remove file (delete from staging area and workspace)
git rm --cached aa remove file (delete from staging area only)
git commit -m "remove" remove file (from Git delete)
git rm -f aa forcibly remove the modified file (delete from the staging area and work area)
git diff --cached or $ git diff --staged to view the updates that have not been submitted
git stash push push the file to a in temporary space
git stash pop pops files from temporary space
---------------------------------------- -----------------
git remote add origin [email protected]:username/Hello-World.git
git push origin master Submit the local project to the server
---- -------------------------------------------------- -----
git pull local and server-side synchronization
-------------------------------------- ---------------------------
git push (remote repository name) (branch name) Push the local branch to the server.
git push origin serverfix:awesomebranch
-------------------------------------------- ----------------------
git fetch is equivalent to getting the latest version from the remote to the local, it will not automatically merge
git commit -a -m "log_message" (-a is to submit all changes, -m is to add log information) Local changes are synchronized to the server:
git branch branch_0.1 master Create branch_0.1 branch from the main branch master
git branch -m branch_0.1 branch_1.0 rename branch_0.1 to branch_1.0
git checkout branch_1.0/master switch to branch_1.0/master branch
du -hs

git branch 删除远程branch
git push origin :branch_remote_name
git branch -r -d branch_remote_name
-----------------------------------------------------------

Initialize the repository and submit it to the remote server
mkdir WebApp
cd WebApp
git init Local initialization
touch README
git add README Add files
git commit -m 'first commit'
git remote add origin [email protected]:daixu/WebApp.gi

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324783222&siteId=291194637