FAQ

IndexTagsArchivesAbout
  • How do I delete all Git branches which have been merged?

    2022-01-17

    Question How do I delete branches which have already been merged? Can I delete them all at once, instead of deleting each branch one-by-one? Answer NOTE: You can add other branches to exclude like master and dev if your workflow has those as a possible ancestor. Usually I branch off of a "sprint-start" tag and master, dev and qa are not ancestors. First, list locally-tracking branches that were merged in remote (consider using -r flag to list all remote-tracking branches).…

    #git

  • How to change the order of DataFrame columns?

    2022-01-17

    Question I have the following DataFrame (df): import numpy as np import pandas as pd df = pd.DataFrame(np.random.rand(10, 5)) I add more column(s) by assignment: df['mean'] = df.mean(1) How can I move the column mean to the front, i.e. set it as first column leaving the order of the other columns untouched? Answer One easy way would be to reassign the dataframe with a list of the columns, rearranged as needed.…

    #python

  • TortoiseGit save user authentication / credentials

    2022-01-17

    Question Is there a way to save GITHUB's user credentials with TortoiseGit? It prompts me the below dialog every time whenever I do a push/pull. I would like to save my user credential information somewhere like how I did with TortoiseSVN. Answer For TortoiseGit 1.8.1.2 or later, there is a GUI to switch on/off credential helper. It supports git-credential-wincred and git-credential-winstore. TortoiseGit 1.8.16 add support for git-credential-manager (Git Credential Manager, the successor of git-credential-winstore)…

    #git

  • How to checkout in Git by date?

    2022-01-15

    Question I am working on a regression in the source code. I'd like to tell Git: "checkout the source based on a parameterized date/time". Is this possible? I also have staged changes in my current view that I don't want to lose. Ideally, I would like to toggle back and forth between the current source, and some version I'm interested in based on a previous date. Answer To keep your current changes You can keep your work stashed away, without commiting it, with git stash.…

    #git

  • Gitignore not working

    2022-01-14

    Question My .gitignore file isn't working for some reason, and no amount of Googling has been able to fix it. Here is what I have: *.apk *.ap_ *.dex *.class **/bin/ **/gen/ .gradle/ build/ local.properties **/proguard/ *.log It's in the directory master, which is my git repo. I'm running Git 1.8.4.2 because I'm on a MacBook running OSX 10.8.6. Answer The files/folder in your version control will not just delete themselves just because you added them to the .…

    #git

  • How to create a new branch from a tag?

    2022-01-13

    Question I'd like to create a new master branch from an existing tag. Say I have a tag v1.0. How to create a new branch from this tag? Answer Wow, that was easier than I thought: git checkout -b newbranch v1.0 If running the above command you get an error warning: refname 'v1.0' is ambiguous. fatal: ambiguous object name: 'v1.0' this is because you also have a branch with name v1.…

    #git

  • How to fast-forward a branch to head

    2022-01-11

    Question I switched to master after developing on a branch for a long time. The log shows: Your branch is behind 'origin/master' by 167 commits, and can be fast-forwarded. I tried: git checkout HEAD It doesn't have any effect. This is because I have checked out an intermediate commit on master. How can I make master stay on head? Answer Try git merge origin/master. If you want to be sure that it only does a fast-forward, you can say git merge --ff-only origin/master.…

    #git

  • «
  • 151
  • 152
  • 153
  • 154
  • 155
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^