Tag: git branch

How to squash my git branch commits into the same branch without rebasing?

I have a local branch, we’re using git-flow with Pull Requests and I’m looking to squash a few commits after receiving PR feedback. How can I squash all my commits (from PR’s for example) into the same branch? I imagine it would be something like: git checkout master # For master git pull # Get […]

Unity meta files and git branching

We’re using “Visible Meta Files” as our internal version control at the moment (if it’s not the correct approach, we wouldn’t have a problem changing it), but currently confused as to what’s best to do when working on a branch. For instance, latest work that I’ve done, is implement an IAP plugin, which created loads […]

git fetch branches with specified prefix

I have following branches in remote origin. ft_d_feature_abc ft_d_feature_xyz ft_d_feature_lam ft_d_feature_ton ft_m_feature_mak ft_m_feature_echo ft_m_feature_laa ft_m_feature_pol I want to fetch branches which are starting with ft_d. How can I achieve this with git fetch? My Git version is 1.7.9.5.

How to follow a file in git

I have deleted a file a couple of times in git, but it keeps turning up again as other branches are merged; I guess something like this: o– a topic –o / \ o– [create file] –o– [delete file] –o– [file exists again] It’s especially hard for me to grasp what’s going on since we […]

Switched Branch After .gitignore and lost .gitinored files

I am new to git, so sorry if this question has already been answered. I’m having trouble finding the answer to this. I wanted to ignore a set of files that had never been committed before for a commit and used the github app to select them and ignore them. I switched to another branch […]

git move locally committed changes to the new branch and push

I am on master. When I do git status I am told $ git status # On branch master # Your branch is ahead of ‘origin/master’ by 13 commits. # (use “git push” to publish your local commits) # nothing to commit, working directory clean So all 13 only exist on my local machine. The […]

Why is the Git feature branch still visible after merge and deletion?

Steps taken I merged a feature branch back into master and deleted the feature branch. But it still shows up in the tree. Result Tree visualisation in SourceTree before deleting the feature branch: Tree visualisation in SourceTree after deleting the feature branch: The feature branch in the left-hand list is gone, as expected, and the […]

Show the log for a different branch

I’m on a branch with some changes. Changing branch is a pain as some files are locked by processes, so to change branch I’d have to stop all the processes which have locks, then stash the changes before checking out the other branch to see it’s log. Is it possible to view the log for […]

How to make gitk show only local branches?

How to make gitk show only local branches? Or even better – can I hide remote branches that do not have corresponding local branches?

Why can't I push my new branch?

I made a new branch, checked it out and made a commit: git branch my-branch [HASH] git checkout my-branch git commit -am “Add some stuff to my new branch” However, I can’t push it to github. git push origin my-branch returns: error: src refspec branch does not match any. error: failed to push some refs […]

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