Questions tagged [git-branch]

1

votes
1

answer
455

Views

Python way to run git log command to fetch details of repository without cloning it

Is there a Python way to run git log command to fetch details of repository without cloning it? I want to run commands on bitbucket server to find all activities of a repository.
Mayank Srivastava
1

votes
2

answer
34

Views

Change in contents of folder on branch change in Git

Say my working directory is C:\Users\f1 and current branch is master. If I checkout to another branch (myBranch), how do the contents of C:\Users\f1 get replaced with those of myBranch?In other words, how does the content of the same folder change with a branch change? Does git delete the current co...
rahs
1

votes
1

answer
655

Views

How to deal with a bugfix in GitFlow (or other process) once a release is ready to ship and merged into develop & master

From https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow : Once the release is ready to ship, it will get merged it into master and develop, then the release branch will be deleted Now that the merge is done : let's say we're now facing instability in production suddenly (ho...
NicolasW
1

votes
1

answer
1.5k

Views

git push origin $BranchName - redirects to https://gitlab.com/users/sign_in

So I am logged into Gitlab in Chrome but from the command line I am signed in then try to push and get the following result: git push origin $BranchName fatal: unable to update url base from redirection: asked for: https://gitlab.com/the-project/the-task/$BranchName.git/info/refs?service=git-receive...
D. Miller
1

votes
1

answer
43

Views

git checkout branch without checking files

I have huge size of git repo in my local system with 10 different branches, In those 10 branch the master repository is around 2 GB. when i switch from any branch1 to master branch, Git is trying to checkout all files in local system itself, how to reduce the time here. [[email protected]_001 myrepo]$ tim...
vinoth
1

votes
3

answer
32

Views

Creating branch in git in master being in a another branch

I want to do something like this. I have a branch called branchA and i want to create a new branch. This new base if the new branch should be the master. How can i do this if i am working in the branchA
Jonny
1

votes
1

answer
65

Views

Delete git branch by anything, not name

I have a problem with deleting git branch. At first I was able to create it using 'git checkout -b ....'. But it seems to me, that I made a mistake while writing, hit something wrong, then backspace. It resulted in wrong name of this branch. I was able to work on this branch, even push it to remote,...
1

votes
1

answer
162

Views

How to create custom Grouping convention for Git Branch?

We recently moved from Perforce to Git and for technical reasons are have to stick with our old naming conventions for branches, which is: For Features: feature_abcd_123 For Bugfixes: bugfix_xyz_6789 For Custom: custom_mnop_8965 It is very difficult (next to impossible) for us to adopt Git’s branc...
ikis
1

votes
5

answer
172

Views

Collecting a list of all branches in a repository in a special format [Git]

Is there a way to collect a list of the branch in a repository and there last commit date? In other words, I would like to print something like this to the stdout: branch_name_1 date1 branch_name_2 date2 branch_name_3 date3 Is it possible? EDIT: I tried to use the following steps: git log --pretty=f...
TTaJTa4
1

votes
1

answer
209

Views

Checking if a Git Branch Exists in Batch

I am trying to determine if a git branch exists in a specific location using batch through Jenkins. From what I understand, Jenkins runs the commands similar to how a Batch shell script would run. After researching this question on Stack Overflow already (and finding several pages about this similar...
quango
1

votes
1

answer
30

Views

No commits available for merging in the Git request

I merged a branch, lets say developer in to another branch lets say main. Then I realized that the changes from developer were not meant to be available in main. I used the remove branch option that created a merge request excluding my changes from main branch. I merged this request and the main bra...
Saurabh Tiwari
1

votes
1

answer
27

Views

git push complete and separate branch to remote repository

I have a Git Server... My Partner created a new branch.... cd C:\profaNew\ProjectosJava git checkout -b diana git branch git add . git commit -m 'Nuevo Proyecto Base' git remote add origin [email protected]:/srv/git/project.git git push -u origin diana Now in my machine, I hope view her branch, But...
QA_Col
1

votes
0

answer
7

Views

Get full commit history from a remote branch to a local orphan branch

I recently wanted to cloned a large repository so, I ended up cloning a single branch. git clone --single-branch dev [email protected]:xyz/abc.git This repo has few other branched namely stage & master. Now my local clone has only the dev branch. My Question: How do I now checkout to the stage branch ?...
naxrohan
1

votes
1

answer
20

Views

How can I restrict branch acces to specific users of Git on centos 7 server?

I successfully configured centos 7 machine as git server. Now, I have a requirement where I want to keep some documents on a branch(say some admin branch) which should be accessible to few of my teammates and not for other teammates. How can I achieve that. Thanks in advance.
Parashuram
1

votes
1

answer
85

Views

How to get the existing Pull Request ID and Url for specific Branch in GitBash without calling Github API?

I need to find the solution of the exact situation, that has been described in the question. I only have a feature Branch ID, for which I need to get the Pull Request ID or Url, on GitBash(2.20.1) or Terminal without calling Github API.. I have already tried this, but it doesn't work for every Branc...
Vicky Dev
1

votes
1

answer
34

Views

How to force changed master history to feature branches based on old history?

My colleague changed history of our master and my feature-branch is based on old history of masters. Simple rebase didn't change my branchs' history to the new (changed) history. Is cherry picking my only option or is there a simpler way to solve this? Creating a new branch would mess up our comment...
mikosty
1

votes
0

answer
22

Views

how to restrict master branch from commits by organisation members also?

I am trying to restrict master from any push. I had followed enter link description here but even after that my team members are able to push the code.I read that the organisation will have access to push .But I want to restrict that as well and keep the push access to only 1 or 2 people. How do I a...
yacky
1

votes
0

answer
33

Views

Ignore local change when switching branch on both branch without stash/commit

I have a git project with 2 branch test and master and a start.sh file. The start.sh file on the remote repository is configured to run the project without specific option, but on my server I need some option (as the ip or the port) so I made a local version of the file, and every time I pull an upd...
JackRed
1

votes
1

answer
23

Views

Git submdule - Change Banch

I have a question regarding submodules in git: I have a repository 'SuperRepo' with submodule 'A'. Submodule 'A' points to branch 'develop' in .gitmodules. If I create a new branch in 'SuperRepo', let's assume 'fancyFeature', I sometimes change the branch of submodule 'A' to a new branch with the sa...
user10228576
0

votes
1

answer
10

Views

Private and public Git repositories with sensitive data

I have a service currently running on Heroku. The way deployment works with Heroku is that you push the code to a git repository, which triggers a build and subsequently a deployment of the new code. Since this is the only way to deploy your service to Heroku, that git repository contains a lot of s...
Anton
1

votes
1

answer
194

Views

How to split commits automatically into different branches?

For my school projects, I was used to have one big repo with several subdirectories for the specific projects. Because I had no time, I always commited anything into the master branch. The problem is, that this turns out to be unpracticable, as it becomes more and more difficult to revert older comm...
fuz
1

votes
2

answer
1.3k

Views

Checking out specific branch from github

I used to pull down jQuery-ui by doing git clone git://github.com/jquery/jquery-ui/ git checkout 1.8.6 This stopped working today. After I do a git clone on an empty repository, the checkout fails with: error: You have local changes to 'demos/spinner/currency.html'; cannot switch branches. Any rec...
Drew
1

votes
1

answer
34

Views

Modify previous commit without modifying working directory

D / A-B-C-E Branch D is my current working directory, however, I want to 'clone' C again, make some changes and commit them to create E without having to change anything I did in D. Then I can continue to develop on D. How can I accomplish this?
CoolGravatar
1

votes
4

answer
1.7k

Views

git going back couple of commits on a branch

I am very new to git, I checked couple of similiar questions, but, the ones I saw was slightly different, and I didn't get a strong grasp about them, so I am posting my own question. I am sole developer on my project. I like to experiment frequently with my code, so I thought using a version control...
yasar
1

votes
1

answer
82

Views

Git branching on a MVC project - 2 or more views with shared core

I'm starting to learn git branching, and I'm developing with other people a web based MVC project (using Zend). We just worked on the master branch since today; now we need to develop tow different views (html aspect, css & co.), so we created a branch, let's call it newview. Obviously we keep devel...
Lorenzo Marcon
1

votes
2

answer
475

Views

Deleting a branch with an invalid name in Git

I've been using Dropbox to keep my source folder synced between two computers. This folder contains my source-code which I version handle with Git. it seems that there was a file conflict and when I did a push, my Git client, pushed an invalid branch to the remote. The branch name is rel_1 (Mridang-...
Mridang Agarwalla
1

votes
2

answer
89

Views

transition branch to be master with git

I've converted an application from Rails 3.0 to 3.1.3 and have it on a branch. I would like to transition the rails 3.1.3 branch to be the new master and a merge doesn't make sense to me. What's the best way to do this? Update I explained this wrong. I moved to Rails 3.1.3 from 3.0 by creating a...
Michael K Madison
1

votes
1

answer
66

Views

Using git, how do a merge a tracked branch back into the remote origin/HEAD?

I got myself into a little bit of a local repo mess. Long story short, I had a copy of a remote repo; I created a branch called 'my_branch' in my local repo; I committed work a few times. I then just pushed the branch to the remote repo. Here's my local repo diagram...(since I've pushed my_branch to...
milesmeow
1

votes
1

answer
130

Views

Git branching django [duplicate]

This question already has an answer here: How can I reconcile detached HEAD with master/origin? 26 answers I am looking to edit some of the documentation found on the django project. To do this I have forked, and cloned to my local machine a copy of the django repository on github. The issue I am f...
coderly
1

votes
1

answer
87

Views

Git: local branchs tracks other local branch

I know that local branches can track remote branches, but there is also the possibility that a local branch tracks another local branch. What is a use-case for this?
Mot
1

votes
1

answer
1.4k

Views

How do I create a branch using git and repo tools while working with android code

I downloaded the android code from source.android.com. Then I created a new branch from this code: repo start mybranch platform/external/webkit Then I tried to switch to the new branch using : git checkout mybranch which failed with this error message: fatal: Not a git repository (or any parent up t...
dead programmer
1

votes
5

answer
57

Views

Creating a branch in git, but nervous about harming existing stable master

I have a precious install on my hard drive: /var/www/lukevan/po2/po This is the 'PO' project. We wish to maintain that version for our customers, but now we need to do a new, experimental branch that may be unstable for awhile until we are ready to merge that back into the live, current, stable PO p...
Volomike
1

votes
1

answer
94

Views

branches on same line as master in network view

I have a small problem using github. I mainly try to work with branches, and merge code back in the master as soon as I have something working. Thing is, all my branches in the network view in github show up on the same line, which makes it completely useless. https://github.com/jlengrand/FaceMovi...
jlengrand
1

votes
1

answer
530

Views

github create project from branch

I have master branch https://github.com/Fivell/PHP_PROJECT/ and recently created new branch for php 5.3 https://github.com/Fivell/PHP_PROJECT/tree/php5.3 But I think It will be better to create fork instead of branch in this case. Can anybody help with it ? How can I create fork of my own project...
Fivell
1

votes
2

answer
152

Views

How to merge my code with code coming from a different repository in git

one month ago i started working on a new function on one of our private repositories on github. I cloned the repository and branched it. I've been working on the branch ever since. In the meantime the code was moved to a different repository on github. Now i need to merge what i've done with the new...
1

votes
2

answer
63

Views

confused about git branches and master interaction

I am working locally. I checked out a branch 'b1' and did some work on it. I want to keep the branch 'b1' the way it is but go back to the master and for it to be like it was before I checked out 'b1'. But when I check out master with 'git checkout master' all the changes I made in the branch are a...
Los
1

votes
1

answer
92

Views

Can I mark submodule to use different then master branch by default

I have fork of a repo as submodule and I have separated branch (that is pull request BTW) and I want my repo to use that feature branch as default for submodule so people that clone my repo will use that feature branch. How can I do this?
jcubic
1

votes
1

answer
34

Views

Git command equivalent

is git clone -b branch1 ssh://[email protected]/project/testkit equivalent to git clone ssh://[email protected]/project/testkit cd testkit git checkout branch1 ?
Codrguy
1

votes
1

answer
97

Views

creating git branch and commiting into separate branches

noob to git: expanding on this question a little I created a repository and committed my README.md to the master branch. My local folder structure is: projectName --README.md -- + part1 -- -- README.md -- -- + src -- + part2 -- + ... I initialized git init in the projectName folder...
user1460015
1

votes
1

answer
86

Views

Git stopped tracking changes

I am in the working directory and I have created a new branch git checkout -b someBranch But after work in some files the status don't show any change git status # On branch someBranch nothing to commit (working directory clean) Any idea of what is causing this issue? Any tip to start tracking agai...
Igor Parra

View additional questions