Questions tagged [branch]
34 questions
112
votes
1 answer
GIT merge master into a branch
I have been developing a new feature on a new branch, and on the side have committed quite a few changes on my master branch.
Is it possible to merge the master branch into my new branch to keep it up-to-date so that I won't have too many merge…
mnml
- 2,051
10
votes
2 answers
Accidentally worked on wrong branch in Git
I did some work on the wrong branch; I forgot to check out the right branch. Is it possible to change to the other branch and commit my changes there?
Ravenix
- 291
8
votes
2 answers
Is it safe to delete a branch from a github fork once it's been merged upstream?
I've only recently tried my hand at forking in github and would like some "best practice" advice.
I created a branch in my fork, and that branch got pulled into master of the upstream project. It no longer appears in the network graph, but it's…
Tim
- 412
- 4
- 9
7
votes
1 answer
PDFs in git, reduce size
I have a git repository with many PDF files in there. The git repository is increasing so much in size that it's very complicated to clone the repository to a new host when the Internet connection is limited...
I used git gc && git gc --aggressive…
reox
- 1,005
7
votes
2 answers
Git branch for instances of a website?
I'm working in a couple of websites, both websites needs almost the same code except for some changes in images and css, or settings.
I'm just finished to read the chapter of branchs of Pro Git book and i'm a bit confused, if a branch is not the…
diegueus9
- 205
7
votes
1 answer
How to set to pull the same branch by default?
When I pull from the new added remotes, I have to specify the branch name explicitly:
$ git pull remote1
...
Error: you didn't specify a branch name.
$ git pull remote1 master
Though I'm working on the master branch.
It maybe useful to pull from…
Lenik
- 18,830
6
votes
1 answer
Go back in time and create branch?
I'm trying to do the following thing in git:
Go back a few commits (master branch)
Create a new branch
Restore the latest commit on the master branch (go forward)
The order is not important, it could be done like:
Create a new branch and switch…
Felix
- 613
6
votes
1 answer
Find the default branch name for a Git repository?
I would like to be able to ask Git "what is the default branch name for this repository?" and I would expect either main or master as the result. I've search git config but haven't been able to find a/the relevant option.
Steven Hepting
- 271
5
votes
2 answers
Can checkout and track git branch, but cannot pull
So we have a branch in our git repo called creative_market. I run the command git checkout --track origin/creative_market which works fine. All of the changes that should be on the creative_market branch are present. However, if I run git pull I get…
Mike Lentini
- 153
4
votes
2 answers
What does [1 note] means in Git(Lab)'s commit tree?
My company is using a private GitLab. I recently looked to the graph of branches and commits, and it showed this. A [1 note] label that looks like the labels GitLab uses to show the branches' heads (but "1 note" isn't one of our branches).
When I…
Motiss
- 101
2
votes
2 answers
Removing a file in a branch in git implies removing it from the master branch as well?
I just faced a situation that seems illogical to me with Git. I have a repo with a plenty of commits, so at this stage it has only one branch (master).
Suppose this branch has a file called MyFile.txt. Now I need to create a different branch…
nKn
- 5,832
2
votes
1 answer
Get git-repository commit into different git-repository branch
Consider the following setup: One Repository1 sits on Bitbucket. A local working copy is situated on my machine. I change files locally, commit and push to Repository1.
Changes in Repository1 (on Bitbucket) (in "master" branch) where made only by…
Strongground
- 21
2
votes
2 answers
Tortoise CVS merge branches
I have two branches DEVELOPPEMENT and DEVELOPPEMENT2.
I would like to merge DEVELOPPEMENT and DEVELOPPEMENT2 into a same branch but not in the HEAD yet.
How to do it with the Tortoise HMI? I cannot find any documentation on that.
Maxbester
- 229
2
votes
2 answers
Merge master functionality into shared branches in Git
Suppose that I have several shared branches on my Git repository, for example: newfeature, experiment and gtkgui, and I share those branches in the origin repository. My team and I make some changes on all branches and push those changes into the…
2
votes
2 answers
git Can't switch branch because of changes I can't commit
I have a git repository that's public on github.
There, I have a local file I don't want to share to the public, while other team members want it to be public, so I did git update-index --assume-unchanged (that file).
Now, I want to switch to a…
milkwood1
- 237