Skip to content

Instantly share code, notes, and snippets.

@tranquangchau
Created August 23, 2015 23:58
Show Gist options
  • Save tranquangchau/5e09bf7271803541a65e to your computer and use it in GitHub Desktop.
Save tranquangchau/5e09bf7271803541a65e to your computer and use it in GitHub Desktop.
Welcome to Git (version 1.9.5-preview20150319)
Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.
Trum-Ma-Tuy@TRUM-MA-TUY-PC /D/xamp/htdocs/blog (master)
$ git add -alll
error: unknown switch `a'
usage: git add [options] [--] <pathspec>...
-n, --dry-run dry run
-v, --verbose be verbose
-i, --interactive interactive picking
-p, --patch select hunks interactively
-e, --edit edit current diff and apply
-f, --force allow adding otherwise ignored files
-u, --update update tracked files
-N, --intent-to-add record only the fact that the path will be added later
-A, --all add changes from all tracked and untracked files
--ignore-removal ignore paths removed in the working tree (same as --no
-all)
--refresh don't add, only refresh the index
--ignore-errors just skip files which cannot be added because of error
s
--ignore-missing check if - even missing - files are ignored in dry run
Trum-Ma-Tuy@TRUM-MA-TUY-PC /D/xamp/htdocs/blog (master)
$ git add --all
warning: LF will be replaced by CRLF in application/config/routes.php.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in readme - router.rst.
The file will have its original line endings in your working directory.
Trum-Ma-Tuy@TRUM-MA-TUY-PC /D/xamp/htdocs/blog (master)
$ git checkout
M application/config/routes.php
M application/controllers/Category.php
A readme - router.rst
Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
Trum-Ma-Tuy@TRUM-MA-TUY-PC /D/xamp/htdocs/blog (master)
$ git status
warning: LF will be replaced by CRLF in application/config/routes.php.
The file will have its original line endings in your working directory.
On branch master
Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: application/config/routes.php
modified: application/controllers/Category.php
new file: readme - router.rst
Untracked files:
(use "git add <file>..." to include in what will be committed)
application/config/routes - Copy.php
Trum-Ma-Tuy@TRUM-MA-TUY-PC /D/xamp/htdocs/blog (master)
$ git commit -a -m "category"
[master warning: LF will be replaced by CRLF in application/config/routes.php.
The file will have its original line endings in your working directory.
70ebe8b] category
warning: LF will be replaced by CRLF in application/config/routes.php.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in readme - router.rst.
The file will have its original line endings in your working directory.
3 files changed, 379 insertions(+)
create mode 100644 readme - router.rst
Trum-Ma-Tuy@TRUM-MA-TUY-PC /D/xamp/htdocs/blog (master)
$ git push
Password for 'https://[email protected]':
To https://[email protected]/jtec/blog.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://[email protected]/jtec/blog
.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Trum-Ma-Tuy@TRUM-MA-TUY-PC /D/xamp/htdocs/blog (master)
$ git push -u
Password for 'https://[email protected]':
To https://[email protected]/jtec/blog.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://[email protected]/jtec/blog
.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Trum-Ma-Tuy@TRUM-MA-TUY-PC /D/xamp/htdocs/blog (master)
$ git push -u origin --all
Password for 'https://[email protected]':
To https://[email protected]/jtec/blog.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://[email protected]/jtec/blog
.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Trum-Ma-Tuy@TRUM-MA-TUY-PC /D/xamp/htdocs/blog (master)
$ git pull
Password for 'https://[email protected]':
Merge made by the 'recursive' strategy.
readme.rst | 72 ++++----------------------------------------------------------
1 file changed, 4 insertions(+), 68 deletions(-)
Trum-Ma-Tuy@TRUM-MA-TUY-PC /D/xamp/htdocs/blog (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
Trum-Ma-Tuy@TRUM-MA-TUY-PC /D/xamp/htdocs/blog (master)
$ git push
Password for 'https://[email protected]':
Counting objects: 17, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 5.36 KiB | 0 bytes/s, done.
Total 10 (delta 6), reused 0 (delta 0)
To https://[email protected]/jtec/blog.git
5e4df42..3cc97d9 master -> master
Trum-Ma-Tuy@TRUM-MA-TUY-PC /D/xamp/htdocs/blog (master)
$
@tranquangchau
Copy link
Author

git_branch

git have branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment