How can I rollback a github repository to a specific commit?

My github has 100 commits in it right now. I need to rollback the repository to commit 80, and remove all the subsequent ones. Why? This repo is supposed to be for merging from miscellaneous users. A bunch of merges went in as commits from me, due to excessive editing. That was due to a […]

DAG vs. tree using Git?

I’ve often read that Git uses the directed acyclic graph (DAG) data structure, with each commit as a node, and things like branches and tags as pointers to nodes. But when I try to visualize my commit history using tools like gitk, it looks more like a tree than a graph since every parent-child relationship […]

git difftool to give directory compare?

This question already has an answer here: Directory comparison of Git branches 3 answers

git: 'credential-cache' is not a git command

I followed these instructions to the letter, including the part about password caching. It seems like the instructions are wrong, because every time I git push origin master I get this error: git: ‘credential-cache’ is not a git command. See ‘get –help’. … at which point I am forced to enter my username and password. […]

Does deleting a branch in git remove it from the history?

Coming from svn, just starting to become familiar with git. When a branch is deleted in git, is it removed from the history? In svn, you can easily recover a branch by reverting the delete operation (reverse merge). Like all deletes in svn, the branch is never really deleted, it’s just removed from the current […]

Is the SHA-1 of commits calculated based only on the content of the tree?

For the sake of an experiment, lets say your git log identifies the following commits commit 16bc8486fb34cf9a6faf0f7df606ae72ad9ea438 // added 2nd file commit 9188f9a25b045f130b08888bc3f638099fa7f212 // initial commit After committing, .git/refs/heads/master points to 16bc8486fb34cf9a6faf0f7df606ae72ad9ea438. Let’s say, after this, i manually edit the .git/refs/heads/master file to point to 9188f9a25b045f130b08888bc3f638099fa7f212 At this point, git status recognizes that a new […]

How to read last commit comment?

Often during a commit ($ git -commit -m “”), I wish to read my last comment to remember what progress I have made. Is there an easy way to directly access the last commit message through command-line? (I’m using Windows.)

when you have secret key in your project, how can pushing to GitHub be possible?

I am trying to push a brand new, empty Rail 3.0.4 project to GitHub, but just realize that the cookie session store has a secret key: In config/initializers/secret_token.rb NewRuby192Rails304Proj::Application.config.secret_token = ’22e8…’ So how can we avoid it being push to GitHub? We can ignore this file (using .gitignore), but without this file, a Rails app […]

warning: remote HEAD refers to nonexistent ref, unable to checkout

This seems like a popular error for different causes. I’ve got a simple bare git repo called “kiflea.git”, I clone it like this: git clone git://kipdola.be/kiflea.git Then git tells me: warning: remote HEAD refers to nonexistent ref, unable to checkout. And yes, there are no versioned files in the map, except for the .git directory. […]

Install npm module from gitlab private repository

We are using GitLab for our private project. There are some forked libraries from github, that we want to install as npm module. Installing that module directly from npm is ok and for example this: npm install git://github.com/FredyC/grunt-stylus-sprite.git …works correctly too, but doing the same for GitLab, just changing domain gets me this error. npm […]

Git Baby is a git and github fan, let's start git clone.