Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

Sunday, 23 December 2012

Git troubleshooting: "fatal: branch - not something we can merge"

Am I in master or in a branch?
$ git branch 
* (no branch)
  master

Merge branch with master (unsuccessfully):
$ git merge  branch
fatal: branch - not something we can merge

Read what a detached head ["* (no branch)"] is ... Solution:
$ git branch tmp
$ git checkout master
$ git merge tmp

Saturday, 22 December 2012

Git: how to revert (discard) changes since last commit

# see the hash of the last commit
$ git log
# discard changes since last commit
$ git reset --hard 423523423432
This reverts all files committed. New files still remain and you should remove them manually
# see which files should be removed, i.e. have been added since last commit 
$ git status

Thursday, 24 November 2011

git: start server and browser project (easy)

$ sudo apt-get install lighttpd
$ git instaweb --start
http://127.0.0.1:1234/
$ git instaweb --stop