Posts

Showing posts with the label git

In git, how do I remove a commit from a branch but keep that commit in a separate branch?

In git, how do I remove a commit from a branch but keep that commit in a separate branch? I have a DEV branch with a history looking like this (with each list item being a separate commit): Suppose I want to "delete" feature 3 from this branch, but I don't want to lose the code in this feature so I want to put it in it's own separate branch. Basically, from the dev branch above, I want to end up with two branches looking like this: DEV BRANCH : NEW BRANCH : Any ideas how I can achieve this in git? Possible duplicate of Move some commits to another branch – phd Jul 2 at 8:51 3 Answers 3 Create a new branch from feature3 . Then reset feature3 from the dev branch. However, if you have pushed these commits you will need to use revert ...

git graph parent child tabular format

Image
git graph parent child tabular format I am working on git and I am very much interested to see my changes into graph format . So I tried below command . git log --oneline --graph --color --all --decorate The above graph is not clear and tough to interpret . Then i found another command , which has GUI. This was little more intuitive. gitk --all After doing some experiment , I thought of building d3 graph for more clear view . Something Like below . For that i need below data in table format . | Commmit ID | Branch | Parent Id | ----------------------------------- | 123ghj | Master | Null | ----------------------------------- | 123hj | Master | 123ghj | ----------------------------------- | 3456jk | Master |123ghj | By keeping commit parent child , I can construct tree kind of structure. Which I will use in d3.js to create graph like visualization . Can you help me to get this parent child structure using git command or group of command in python . ...

CodeIgniter and GIT: What not to check-in?

CodeIgniter and GIT: What not to check-in? This is my first attempt with CodeIgniter and I'm trying to figure out how to configure it against a GIT repo. The basic idea here is to avoid checking-in framework files and somehow keep only my work in GIT. What is the default/best practice here. Do people commit entire codeigniter folder into source control? Looking at the default .gitignore file, it doesn't look like they want to exclude framework folders like system and user_guide etc. .gitignore system user_guide My idea is to keep XAMPP and CodeIgnitor in default location ( c:xampp ) and keep my code in source code in, say D:My ProjectsNewExcitingWebsite (with models , views and controllers folders therein) and then redirect codeigniter to look towards that folder by setting variables in config files. Is that the correct way to go? If yes, how do I set path for Controllers ? There is a variable for views folder that can be set, but none for controllers and models. c:xampp...

How to read file's content from GitHub file with a specific branch name?

How to read file's content from GitHub file with a specific branch name? In branch name, qa03 , in my repository, repo1 , I have a file, environment.yml . qa03 repo1 environment.yml The content of environment.yml is following: environment.yml # This is chef config file chef: - xxx/chef - xxx/faster-git-clone bam: - xxx/asd - V20180820_902 I want to read this whole file from my python script and store it into my string (so that I can send it to my Trello Card). Q: How do I read the content of the file from GitHub repo with specific branchname? (below is my pseudocode) .... # Read `environmet.yml from repo1/qa03`, and send it to Trello. string_content = read('repo1:qa03/environment.yml') #Q: how??? send(string_content) 1 Answer 1 you can get branch by modifying the following part of the url: https://github.com/username/repositoryName/blob/branchName/path/to/file or in your case: ...

“Unable to find remote helper for 'https'” during git clone

“Unable to find remote helper for 'https'” during git clone I am unable to clone HTTPS repositories. I can clone SSH repos fine, but not HTTPS repos. I cannot test the GIT protocol since I am behind a corporate firewall. This is what I am trying to do: $ git clone https://github.com/nvie/gitflow.git Cloning into gitflow... fatal: Unable to find remote helper for 'https' I have so far tried the following (based on Google searches) apt-get build-deps apt-get ./configure --prefix=/usr --with-curl --with-expat ./configure --prefix=/usr --with-curl=/usr/bin/curl I have tried everything I can find on the internet with no luck. Can anyone help me? Git version = 1.7.6.4 OS = Ubuntu 11.04 Sorry to be obvious, it sounds like curl isn't installed. do curl --help and see if it is. – mike jones Nov 30 '11 at 19:09 ...

File History in GitKraken

Image
File History in GitKraken I am looking for a solution in GitKraken to view complete file history past renamed changes. I have been using the fuzzy finder in GitKraken Free Version since very long but couldn't find any option to view the history of the file before it is renamed. In Git, this could be achieved by: git log --follow filename git log --follow filename Any help would be greatly appreciated. 1 Answer 1 If git correctly realized the file was renamed, GitKraken will show you if you look at the files history (via Fuzzy Finder or right click -> File History). Below the latest commit shown in the commit list, it will say RENAMED from <old_filename> . When you click <old_filename> , the old files history will be shown, with a hint at the topmost commit saying RENAMED to <new_filename> . RENAMED from <old_filename> <old_filename> RENAMED to <new_filename...

How can i git init in existing folder [duplicate]

How can i git init in existing folder [duplicate] This question already has an answer here: I have a git repository that contains folders and files. And have locally a same folder as in git but a little bit changed files but not connected to git. How can i connect my local folder to the same git and commit all changes that i have done? This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. 1 Answer 1 If your local folder is not a git repository, you should make it a repository first and commit your changes in a new branch then add a remote linking to your existing repository where you want to push your branch containing the changes. $ cd path/to/your/local/directory $ git init # make it a git repository $ git checkout -b my_awesome_branch # checkout to a new branch containing your local changes $ git add --all $ ...