git

Can't Push After git reset --soft HEAD^

Hey guys, just now I committed and pushed something (yes, my mistake on the push) that I decided I should 'revert' or 'undo'. So I was told to issue git reset --soft HEAD^ on my end, and I figured this would somehow create a 'revert' commit that once committed would make it as if the change never happened. I don't mind if the history of ...

Definitive recommendation for git autocrlf settings

I use Windows, Mac OS X and linux on a daily basis. I use git in all these environments, pulling from repos that are used by folks with different choices for line endings. Are there definitive recommendation for setting core.autocrlf in my situation? ...

Git with a "two-stage remote"

I have a project hosted on GitHub and I would like to work locally on it. I have multiple Computers that need to access it and I would like to share code between them. However, I do not want all of these commits to go on GitHub, so a simple "clone and then just push/pull" approach does not suit. Essentially, I want this: [GitHub] --> [...

Viewing Unpushed Git Commits

How can I view any local commits I've made, that haven't yet been pushed to the remote repository? Occasionally, git status will print out that my branch is X commits ahead of origin/master, but not always. Is this a bug with my install of Git, or am I missing something? ...

New commits aren't on the head

Long story short*, I did some things with my git repository that I don't know how to do, and ended up detaching my head, that is, when I commit master isn't up to date. How can I fix this? Do I have to merge? (If so, what are the exact commands I want to run?) When I run git branch, it tells me I'm currently on no branch $ git branch...

Cannot Commit in Cygwin/Git, Windows XP [Unrecognized TERM Type]

Same issue when I try to open vi. bash is the shell I'm using. vi, or git commit, fails miserably saying "Unrecognized TERM Type". I did some googling. They all suggests setting the TERM type manually like export TERM=vt100 Tried and failed. stackoverflow is going to be my last hope. or maybe I should let go of cygwin/git and try s...

How can I view all the git repositories on my machine?

Is there a way in which I can see all the git repositories that exist on my machine? Any command for that? ...

How do I count the number of git commits affecting a given subtree?

My version number looks like 0.1.3 and has two components: 0.1 (the tag) 3 (commits after tag) All this information easy to obtain from git describe --tags. For version 0.1.3 git describe may look like 0.1-3-g53d4dec All of this works fine, but I'm looking for the number of commits affecting only a given subtree, not the whole r...

Why does git-for-each-ref fail to sort tags correctly?

When I have a repository with both lightweight and annotated tags, git-for-each-ref only seems to sort one of the sets. I would like to modify my call to for-each-ref to get output which sorts all the tags and intermixes them in the output. For example: bash-3.2$ git tag | xargs -I T git log -n 1 --format='%at T' T | sort -rn | awk '...

Dissallow deletion of Master branch in git

I'm trying to setup a git hook that will disallow anyone to delete the master, alpha, and beta branches of our repository. Can anyone help with this? I have never done a git hook so i don't want to try my luck in developing my own without a little help. Thanks in advance. ...

How to track two version of a project in one GIT repository?

I have two versions of one project in one local git repository. I have to commit this repository into 2 remote repositories, one for each version; LOCAL GIT(V1/V2) -> REMOTE GIT(V1), REMOTE GIT(V2) I have some files in the LOCAL GIT repository which should only go to REMOTE GIT(V1) and other should only go to REMOTE GIT(V2). Now I comm...

git: How do I overwrite all local changes on merge?

Here's the situation. I'm working on the master branch. I create file1 and commit. I create file2 and commit. Whoops. I may want to use file2, someday, but it's definitely not something that should be put in the master branch. So that I don't lose file2 I use git checkout head~1 git branch new-branch git checkout new-branch so that I...

In SVN you can check out a portion of the file structure, can you do the same in GIT

In SVN you can checkout a portion of a repository ie: http://some-url.com/repo/app1/trunk/plugins/plugin1 Can you do the same when you git clone? As I cannot get this to work Thanks ...

Creating submodules in a recently converted svn to git repo

I have just recently converted an old company svn repo which has a bunch of projects into a git repo ie. repo project-1 project-2 project..n From within this new git repo how would you recommend creating a submodule for each individual project? ...

Proprietary + Open Source setup in Git? (eg. chrome/chromium)

How would you setup an code repository where you have a proprietary version and an open source version, say like Chrome and Chromium? With Git, would you use two branches or two repositories? How would you keep the "private" version up to date with the open source one? ...

Can Git-svn be used on large, branched repositories?

I am trying to use git as a frontend to a svn repository in order to be able to use git's nice features like simple branching, stashing etc. The problem is that the SVN repository is quite large (8,000 revs) and contains lots of branches and tags (old as well as new). It's a near standard layout, with a config containing fetch, branche...

Having trouble checking out master in git after removing directory from repository in branch.

So I was working in a branch and decided to remove my docs directory from the repo using git rm -r --cached docs. This all went well. Committed, working directory clean, all good. Now when I try to git checkout master so that I can merge this branch back into master I get the following error: error: Untracked working tree file 'docs/bin...

Git Merge Driver - File Attributes

When using a custom driver for merging in Git what is the full file path of the Git attributes /arguments you pass to the driver? Ex: driver = filfre %O %A %B What is the full file path of the three files, %O, %A, and %B? -Tanner ...

git error "Cannot rewrite branch(es) with a dirty working directory".

"Cannot rewrite branch(es) with a dirty working directory". I am new to Git - I tried googling for an answer to no avail. What does this error mean? What should/can I do? ...

GIT: Do I need to commit my branch before checking out another branch, what about Stash?

I'm new to Git and a bit confused. I have Master branch and have created a second feature branch. If I make changes in my feature branch and then switch to Master, will my changes be lost if I don't commit? Where does stash come into play, is it something you do before you switch branches (but don't want to commit) or is it to sim...