FAQ

IndexTagsArchivesAbout
  • How to split the last commit into two in Git?

    2022-04-27

    Question I have two branches, master and forum, and I've just made some modifications in forum that I'd like to cherry-pick into master. But unfortunately, the commit I want to cherry-pick also contains some modifications that I don't want. The solution would probably be to somehow delete the wrong commit and replace it with two separate commits, one with changes I want to pick in master, the other with the remaining changes.…

    #git

  • The shortest possible output from git log containing author and date

    2022-04-27

    Question How can I show a git log output with (at least) this information: * author * commit date * change I want it compressed to one line per log entry. What's the shortest possible format for that? (tried --format=oneline but that does not show the date) Answer git log --pretty=format:"%h%x09%an%x09%ad%x09%s" does the job. This outputs: fbc3503 mads Thu Dec 4 07:43:27 2008 +0000 show mobile if phone is null... ec36490 jesper Wed Nov 26 05:41:37 2008 +0000 Cleanup after [942]: Using timezon ae62afd tobias Tue Nov 25 21:42:55 2008 +0000 Fixed #67 by adding time zone supp 164be7e mads Tue Nov 25 19:56:43 2008 +0000 fixed tests, and a 'unending appoi 93f1526 jesper Tue Nov 25 09:45:56 2008 +0000 adding time.…

    #git

  • Difference between git checkout --track origin/branch and git checkout -b branch origin/branch

    2022-04-25

    Question Does anybody know the difference between these two commands to switch and track a remote branch? git checkout -b branch origin/branch git checkout --track origin/branch I think both keep track of the remote branch so I can push my changes to the branch on origin, right? Are there any practical differences? Answer The two commands have the same effect (thanks to Robert Siemer’s answer for pointing it out). The practical difference comes when using a local branch named differently:…

    #git

  • Git merge hotfix branch into feature branch

    2022-04-25

    Question Let’s say we have the following situation in Git: A created repository: mkdir GitTest2 cd GitTest2 git init Some modifications in the master take place and get committed: echo "On Master" > file git commit -a -m "Initial commit" Feature1 branched off master and some work is done: git branch feature1 git checkout feature1 echo "Feature1" > featureFile git commit -a -m "Commit for feature1" Meanwhile, a bug is discovered in the master-code and a hotfix-branch is established:…

    #git

  • How do I count the NaN values in a column in pandas DataFrame?

    2022-04-25

    Question I want to find the number of NaN in each column of my data. Answer Use the isna() method (or it's alias isnull() which is also compatible with older pandas versions < 0.21.0) and then sum to count the NaN values. For one column: >>> s = pd.Series([1,2,3, np.nan, np.nan]) >>> s.isna().sum() # or s.isnull().sum() for older pandas versions 2 For several columns, this also works: >>> df = pd.…

    #python

  • How can I stage and commit all files, including newly added files, using a single command?

    2022-04-24

    Question How can I stage and commit all files, including newly added files, using a single command? Answer Does git add -A && git commit -m "Your Message" count as a "single command"? Edit based on @thefinnomenon's answer below To have it as a git alias, use: git config --global alias.coa "!git add -A && git commit -m" and commit all files, including new files, with a message with: git coa "…

    #git

  • How to use Git for Unity3D source control?

    2022-04-24

    Question What are best practices for using Git source control with Unity 3D, particularly in dealing with the binary nature of Unity 3D projects? Please describe the workflow, what paths would be included in .gitignore, what settings should be set in Unity and/or the project, and any other special things that should be noted. Note: I realize that using the Asset Server is the Unity-recommended way, but I would like to use Git for a variety of reasons.…

    #git

  • «
  • 121
  • 122
  • 123
  • 124
  • 125
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^