FAQ

IndexTagsArchivesAbout
  • How to cherry-pick a range of commits and merge them into another branch? [duplicate]

    2023-05-26

    Question This question already has answers here: </div> How can I selectively merge or pick changes from another branch in Git? (29 answers) Closed 6 months ago. I have the following repository layout: master branch (production) integration working What I want to achieve is to cherry-pick a range of commits from the working branch and merge it into the integration branch. I'm pretty new to git and I can't figure out how to exactly do this (the cherry-picking of commit ranges in one operation, not the merging) without messing the repository up.…

    #git

  • Transfer git repositories from GitLab to GitHub - can we, how to and pitfalls (if any)?

    2023-05-26

    Question Can one transfer repositories from GitLab to GitHub if the need be. If so, how exactly can I go about doing the same? Also, are there any pitfalls in doing so or precautionary measures that I need to keep in mind before doing so given that I may decide to eventually move them to GitHub (as it has more features at the moment that I might find handy for my project).…

    #git

  • Can I use git diff on untracked files?

    2023-05-24

    Question Is it possible to ask git diff to include untracked files in its diff output, or is my best bet to use git add on the newly created files and the existing files I have edited, then use: git diff --cached ? Answer With recent git versions you can git add -N the file (or --intent-to-add), which adds a zero-length blob to the index at that location. The upshot is that your "…

    #git

  • View a file in a different Git branch without changing branches

    2023-05-24

    Question Is it possible to open a file in a git branch without checking out that branch? How? Essentially I want to be able to open a file in my github pages branch without switching branches all the time. I don't want to modify it, just want to view it. Answer This should work: git show branch:file Where branch can be any ref (branch, tag, HEAD, ...) and file is the full path of the file.…

    #git

  • Finding diff between current and last version

    2023-05-23

    Question Using Git, how can you find the difference between the current and the last version? git diff last version:HEAD Answer I don't really understand the meaning of "last version". As the previous commit can be accessed with HEAD^, I think that you are looking for something like: git diff HEAD^ HEAD That also can be applied for a :commithash git diff $commithash^ $commithash As of Git 1.8.5, @ is an alias for HEAD, so you can use:…

    #git

  • How to check if any value is NaN in a Pandas DataFrame

    2023-05-23

    Question In Python Pandas, what's the best way to check whether a DataFrame has one (or more) NaN values? I know about the function pd.isnan, but this returns a DataFrame of booleans for each element. This post right here doesn't exactly answer my question either. Answer jwilner's response is spot on. I was exploring to see if there's a faster option, since in my experience, summing flat arrays is (strangely) faster than counting.…

    #python

  • Git add and commit in one command

    2023-05-22

    Question Is there any way I can do git add -A git commit -m "commit message" in one command? I seem to be doing those two commands a lot, and if Git had an option like git commit -Am "commit message", it would make life that much more convenient. git commit has the -a modifier, but it doesn't quite do the same as doing git add -A before committing. git add -A adds newly created files, but git commit -am does not.…

    #git

  • «
  • 16
  • 17
  • 18
  • 19
  • 20
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^