git add Name
Directly Edit local file then commit, push.
- Change last push
git add . git commit –amend git push –force branch
git rm –cache Name
git fetch origin
- git push origin wil_sws
- Stackoverflow
- For example, branch email and staging, copy everything in staging to email and overwrite it.
$ git checkout email $ git tag old-email-branch # this is optional $ git reset –hard staging $ git merge -s ours origin/email $ git push origin email
# Ignore everything
*
# but
!script.pl
!.gitignore
- git branch -d <branch_name>
- git push origin –delete <branch_name> (or git push origin :<branch_name>)
- git reflog show (find revision hash)
- git checkout <revision> .
- git reset –hard HEAD^1
- edit & commit
or
- git rm –cached badfile
- edit & git commit –amend
- git pull (will auto merge unconflict parts)
- edit conflict file (edit file with <<< >>> )
- git add & commit
- git rm –cached ‘merge-*’ : delete remote file start with merge-
- git commit & push
- ‘-a’ will auto add the modified file which was git add before
but for new file, we have to add, or create alias
- what is head: http://stackoverflow.com/questions/2304087/what-is-git-head-exactly
- git reset -hard: http://stackoverflow.com/questions/9529078/git-for-a-beginner-git-reset-hard-head
- git reset in plain english: http://stackoverflow.com/questions/2530060/can-you-explain-what-git-reset-does-in-plain-english
- list all tags git tag -l
- git remote set-url origin new_url