Tag: commit

How to git ignore ipython notebook checkpoints anywhere in repository

This is mostly a git question. I want to commit my ipython notebooks but gitignore the checkpoints. The repo has multiple folders which each have ipython notebooks, therefore just ignoring a single directory does not solve it. I want to keep adding new folders with notebooks inside without worrying about it. My hunch is that […]

File not shown in git diff after a git add. How do I know it will be committed?

I had an untracked file which was not appearing in a git diff and when I added it to the ‘changes to be committed’ area, it still doesn’t show up in the git diff. I shows up with a git status -v when I do a diff against HEAD. I’m still very new to git, […]

Do you push every single commit?

I would like, if someone could give me more detail in working with git and remote repositories. I haven’t worked with remote repositories, yet. To the local repository you commit smaller changes that may not be too world-shattering. What is pushed to the remote repository? Every local commit? Or the overall-work that was done, which […]

Preparing a git commit messaging before committing?

Is it possible to prepare a commit message prior to a commit, meaning that I will type my commit message before the actual commit or during the working dir so that I know what I am working on and I know what this branch or commit will be all about. When I say “before” I […]

GitHub pull request showing commits that are already in target branch

I’m trying to review a pull request on GitHub to a branch that isn’t master. The target branch was behind master and the pull request showed commits from master, so I merged master and pushed it to GitHub, but the commits and diff for them still appear in the pull request after refreshing. I’ve doubled […]

How do I list just the files that would be committed?

Is there any way to get a list of files that will be committed when I type the following? git commit -m “my changes” git status lists too much. I could strip out all the words, but I’d rather not. And I don’t want to be told about untracked files. I’ve tried git ls-files -md […]

Git: Stage into Commit, what is the right workflow?

I just created a big piece of code I want to commit in several separate commits. So I can stage relevant parts, commit, stage, commit, … and so on until I have all my changes commited. The missing part is how can I test whether I split the commit correcty. I.e. whether the part that […]

git revert commit/push but keep changes

It goes like this: I have files A and B that I modified I’m only suppose to commit and push A, but accidentally committed both and pushed both A and B I did a “git push old-id:master” so on github it shows “Master is now old-id” where old-id is the last commit before me, so […]

How to delete the last n commit on Github and locally?

I’m trying to delete the last 2 commits in one of my GitHub repositories. I’ve tried as suggested here : git push -f origin HEAD^^:master. It seems that it works, the last two commits are removed. Then I deleted them from my local repository with git rebase -i HEAD~2. I remove the lines than are […]

Remove file from commit

I have a list of changed files in git repository. There is one file I don’t wanna commit for the current moment. Can I do: git commit -a To commit all files and then somehow remove that file from current commit? After such removing it should still be in the list of uncommited files.

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