Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jm tips #16

Merged
merged 2 commits into from
Mar 21, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix prompt to match style guide
  • Loading branch information
xinsight committed Aug 1, 2014
commit 9f20e13e414874e19a66719bc2ecce2ab57ef288
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,28 +281,28 @@ Confirm that you haven't pushed your changes to the server.
`git status` should show how many commits you are ahead of origin:

```
$ git status
# On branch bug123
# Your branch is ahead of 'origin/bug123' by 2 commits.
(bug24)$ git status
# On branch bug24
# Your branch is ahead of 'origin/bug24' by 2 commits.
# (use "git push" to publish your local commits)
#
```

```
# one commit
git reset --hard HEAD^
(bug24)$ git reset --hard HEAD^
# two commits
git reset --hard HEAD^^
(bug24)$ git reset --hard HEAD^^
# four commits
git reset --hard HEAD~4
(bug24)$ git reset --hard HEAD~4
```

## I want to discard my local, uncommitted changes

```
git reset --hard
(master)$ git reset --hard
# or
git checkout -f
(master)$ git checkout -f
```

## I want to add changes in one file to two different commits
Expand All @@ -312,6 +312,6 @@ git checkout -f
## I want to remove a file from git but keep the file

```
git rm --cached log.txt
(master)$ git rm --cached log.txt
```