having A <- B <-C (branch foo), and A <- D (master), how can I 'move' the commit from foo onto master (while still having uncommited files in foo)? so I get A <- B <- D <- C (master) and just A <- uncommited files on foo? (A is the oldest commit, C is the youngest)

hi, I have almost 100 branches in one repository and need to rename most of them. I’m looking for an efficient and painless way to do that. typing "git branch -m some<TAB> foobar/other_name" is not efficient at all. Any ideas, hints, experience?

Hi. I've got /web/uploads/* in my .gitignore file. Now I created a .gitkeep file in web/uploads/photo-pinboard/large/ and added !web/uploads/photo-pinboard/large/.gitkeep in my .gitignore. However the .gitkeep file doesn't show up when I git status. Anyone knows why?

[!deploy] Git is not a deployment tool, but you can build one around it (in simple environments) or use it as an object store(for complex ones). Here are some options/ideas to get you started: http://gitolite.com/deploy.html

i use composer (PHP) for dependency management. the vendor directory is not in .gitignore. when i run "git status" then i see no changes in my working branch. when i want to change to another branch it lists the files of a package i just installed: "error: The following untracked working tree files would be overwritten by checkout"

i have a bare repo that i pushed to the remote.. then i re-clone the pushed repo locally to another folder so i can do a check between the bare repo and the re-cloned repo to validate that the pushed worked correctly. (validating some scripts)

I had some overlapping changes in a checkout and I wanted to create a different branch to commit them to. From the branch I was in, and with the changes uncommitted, I did a git checkout -b, and committed the changes to that branch instead. However, when I go to create a pull request, all the changes from both branches are in it. How can I avoid that?

Artynok: hi! I'd like to automatically welcome you to #git, a place full of helpful gits. Got a question? Just ask it — chances are someone will answer fairly soon. The topic has links with more information about git and this channel. NB. it can't hurt to do a backup (type !backup for help) before trying things out, especially if they involve dangerous keywords such as --hard, clean, --force/-f, rm and so on.

I've been working with a repo since 6 months ago, using gitlab in my own server. Now new people is joining to our team. So I did a clone, deleted many files, commit and push to this clone in the server, so the new guy fork and work on it. Later with merge request we join the work.

I have an existing commit. I'd like to roll back to an earlier commit and save some of the changes to a stash. To do so, I git reset --soft HEAD^; git add/commit the files I want to keep; and then try to git stash save. But the git commit ends up also committing those other changes that I just want to stash. What's going on?

[!rewrite] Rewriting public history is not recommended. Everyone who has pulled the old history will have to do work (and you'll have to tell them to), so it's infinitely better to just move on. If you must, you can use `git push --force-with-lease <remote> <branch>` to force (and the remote may reject that, anyway). See http://goo.gl/waqum

doebi: you probably have a ton of unreferenced things anyway. If you were constantly trying to delete all of that you'd have no time left for anything else. git is built like that by design, to prevent you from loosing data.

Hi, I'm trying to write a small git script that lists all my local branches, and shows if they're tracking a remote. But I'm having trouble, since rev-parse gives me an error if @{upstream} is missing or not configured.

now I do have a question: I have added two remotes with git add remote gitrepo1.git and same with 2; now I'm pushing to both via git push --set-upstream remote1 master; git push --set-upstream remote2 master; is there any way to automatically push to both upstreams without having to push twice?

I'm trying to split a repo. git subtree split -P blah/asdf/fdsa -b fdsa seems to discard the path. Or, cd ../somewhere && git init && git pull ../original populates the directory with the files that were in the subdirectory without a path. Is there a way to keep the path using subtree?