git-branch

Multiple streams over single project in Git?

眉间皱痕 提交于 2019-12-23 01:46:09
问题 I went through blog regarding Git best practices model. As we are going to make Git as our major head for SCM for the upcoming projects in our organization, I have some doubts, regarding them not able to find much over internet. Our project architecture is: We have only one Main-Project and in this project we have 8-10 sub-projects say SP1, SP2 ... SP8. All these projects are owned by their individual group members and they have nothing to do with any other Sub-Project. We also want to have

unable to commit a file, accidentally renamed with mv

≯℡__Kan透↙ 提交于 2019-12-23 01:12:33
问题 I've accidentally used mv to rename a file which was under git. I renamed the file from lower case to uppercase keeping the name same. mv abc.java ABC.java I've also made changes and committed the file after that . How do I now make an actual git rename of this file? Git bash doesn't seem to understand the difference between ABC.java and abc.java. I'm not sure what changed on master(by others) but after moving to a branch, I'm no more able to commit my changes to the file. It says the old

Retroactively treat line of Git commits as a branch

谁说胖子不能爱 提交于 2019-12-22 14:03:51
问题 A bunch of questions ask how to rewrite ( rebase ) some commits so that they appear on a branch, but these all seem to assume that rebase is actually necessary, i.e. that the commits wanted for the branch are interspersed with commits wanted on master (whether made by “you” or others). This question is simpler: I have a clone of a repository on the master branch, and I made a bunch of commits intending to create a GitHub pull request. Normally I would have run git checkout -b new-feature

How to make individual pull requests vs “stacking” them on top of each other in Github?

安稳与你 提交于 2019-12-22 10:59:45
问题 I'm not getting anywhere with this... trying to make 2 separate pull requests. Maybe someone can point me to what is wrong. Here is what I'm doing: Fork repo FOO and clone to my machine git clone https://github.com/myself/FOO.git Set upstream to track FOO git remote add upstream https://github.com/maker_of_FOO/FOO.git Create new branch and checkout git branch FOO_fix_1 git checkout FOO_Fix_1 Edit files and commit and push git commit git push Push new branch to my fork of FOO git push -u

Difference between “(no branch)” and “(detached at abc1234)”

ε祈祈猫儿з 提交于 2019-12-22 09:50:18
问题 Normally when you run something like this inside of a git repository: git checkout abc1234 You end up in a detached HEAD state. If you run git branch , the output will look something like this: * (detached from abc1234) master This is fine and expected behaviour. I've been playing around with pygit2 recently, and have come across something I haven't seen before. Let's say I do the following: repo = pygit2.discover_repository("/path/to/repo") repo.head = "abc1234" I would expect the repository

Git: how to set remote in existing repo

别说谁变了你拦得住时间么 提交于 2019-12-22 07:54:13
问题 One question please I have a project on git with differents branches: Master Pre Dev .... I've installed my project files in another server by FTP (not by git pull or git clone) ir order to create a dev enviroment. The folder of the project in dev enviroment don't have a git repo. Can I set that this folder is a existing repo (dev branch) without do a git pull or git clone? 回答1: Go to your project folder. Add a remote origin with your existing repository URL. $ git init $ git remote add

How to create branch-specific files on GitHub

别说谁变了你拦得住时间么 提交于 2019-12-22 05:43:05
问题 I would like to have branch-specific files with the same name. I need to be able to merge from my development branch to master without changes made in this file. For example: Let's assume that I would like to have two different readme.md files. In one I would like to have content: MASTER and in another DEV . But if I try to do it, while creating pull-request GitHub will try to merge this file, which is exactly my problem. I don't want GitHub to merge this file each time I make changes. What

how do I remove a remote branch when I get an error?

倖福魔咒の 提交于 2019-12-22 05:09:26
问题 I have tried the following command and it fails. git push origin :next remote: error: denying ref deletion for refs/heads/next To blah.git ! [remote rejected] next (deletion prohibited) error: failed to push some refs to 'blah.git I am using gitolite and cannot find any of this error message in the hooks. How can I disable this so that I can delete or rename this remote branch? When I run git branch -r -d origin/next, it appears to go away, but the next git pull brings it right back. 回答1:

Benefits of using git branches vs. multiple repositories

孤街浪徒 提交于 2019-12-22 03:46:58
问题 We are doing development for automation code. Our code automates the company's products and is synced to a particular product version. Currently, we have 1 big Git repository with multiple branches in it - v1.0, v1.1, v2.0 (automation for version 1.0 goes in v1.0 branch, and so on). What are the advantages and disadvantages of having these in a single repository with branches vs. keeping each version code in a separate repository ? Both solutions can work, the answer i'm looking for is a list

How to git svn fetch only branches/tags with certain patterns?

穿精又带淫゛_ 提交于 2019-12-21 20:22:03
问题 I want to check out Boost library using git-svn, and I only want to checkout trunk and tags starting from version 1.35, i.e. tags/release/Boost_1_35 and up. My config looks like this: [svn-remote "svn"] ignore-paths = ^tags/release/(?i:(?!boost)|[^/]*(?:beta|rc)|boost_(?:0|1_[1-2]|1_3[0-4]))[^/]*/ url = https://svn.boost.org/svn/boost fetch = trunk:refs/remotes/svn/trunk tags = tags/release/*:refs/remotes/svn/tags/* However, git fetch still fetches tons of unrelated tags such as svn/tags