Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ git init test
- Initialized empty Git repository in test/.git/
- $ cd test
- $ echo hello > file
- $ git add file
- $ git commit -m "adding file"
- [master (root-commit) 6f0412e] adding file
- 1 file changed, 1 insertion(+)
- create mode 100644 file
- $ git st
- # On branch master
- nothing to commit (working directory clean)
- $ echo file > .gitignore
- $ git st
- # On branch master
- # Untracked files:
- # (use "git add <file>..." to include in what will be committed)
- #
- # .gitignore
- nothing added to commit but untracked files present (use "git add" to track)
- $ vim file # make some changes
- $ git st
- # On branch master
- # Changes not staged for commit:
- # (use "git add <file>..." to update what will be committed)
- # (use "git checkout -- <file>..." to discard changes in working directory)
- #
- # modified: file
- #
- # Untracked files:
- # (use "git add <file>..." to include in what will be committed)
- #
- # .gitignore
- no changes added to commit (use "git add" and/or "git commit -a")
- # although 'file' has been added to .gitignore, changes show up because it was
- # already tracked
- $ git rm --cached file
- rm 'file'
- $ git st
- # On branch master
- # Changes to be committed:
- # (use "git reset HEAD <file>..." to unstage)
- #
- # deleted: file
- #
- # Untracked files:
- # (use "git add <file>..." to include in what will be committed)
- #
- # .gitignore
- $ git commit -m "deleted file from repo"
- [master 0e9cd8f] deleted file from repo
- 1 file changed, 1 deletion(-)
- delete mode 100644 file
- $ vim file
- $ git st
- # On branch master
- # Untracked files:
- # (use "git add <file>..." to include in what will be committed)
- #
- # .gitignore
- nothing added to commit but untracked files present (use "git add" to track)
- $ vim .gitignore # now remove the line which says 'file'
- $ git st
- # On branch master
- # Untracked files:
- # (use "git add <file>..." to include in what will be committed)
- #
- # .gitignore
- # file
- nothing added to commit but untracked files present (use "git add" to track)
- # file shows up again as untracked, as I expected
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement