Which python am I using?

First I modified my $PATH: sudo nano /etc/paths so that /Library/Frameworks/Python.framework/Versions/3.6/bin was not being invoked. I made sure my paths were in the right order so that python looked for /usr/local/bin/python3 and /usr/local/bin/python2 first to force the issue. However, $ python3 –version still returned Python 3.6.0, though brew says python3 3.6.2 already installed. brew doctor to the rescue: homebrew recommended a couple things. python was incorrectly symlinked so … Read more

Stash just a single file

I think stash -p is probably the choice you want, but just in case you run into other even more tricky things in the future, remember that: Stash is really just a very simple alternative to the only slightly more complex branch sets. Stash is very useful for moving things around quickly, but you can accomplish more complex things with … Read more

How do I update or sync a forked repository on GitHub?

In your local clone of your forked repository, you can add the original GitHub repository as a “remote”. (“Remotes” are like nicknames for the URLs of repositories – origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms … Read more

How can I give access to a private GitHub repository?

If you are the owner it is simple: Go to your repo and click the Settings button. In the left menu click Collaborators Then Add their name. Then collaborator should visit this example repo link https://github.com/user/repo/invitations Source: Github Docs.

Remove a git commit which has not been pushed

I did a git commit but I have not pushed it to the repository yet. So when I do git status, I get ‘# Your branch is ahead of ‘master’ by 1 commit. So if I want to roll back my top commit, can I just do: given that when I do git log I get: commit eb27bf26dd18c5a34e0e82b929e0d74cfcaab316 Date: Tue … Read more

Stash just a single file

I think stash -p is probably the choice you want, but just in case you run into other even more tricky things in the future, remember that: Stash is really just a very simple alternative to the only slightly more complex branch sets. Stash is very useful for moving things around quickly, but you can accomplish more complex things with … Read more

“Cannot publish, unborn head” error message

The error is due to a file in “Desktop/MY REPOS/The-Tech-Academy-C-Sharp-Coding-Projects/AppData/Local/Microsoft/VisualStudio/15.0_8067392e/VTC/” having a name that is too long. The filename looks like it is generated by a tool, not written by you. In fact it looks like the whole “Desktop/MY REPOS/The-Tech-Academy-C-Sharp-Coding-Projects/AppData/Local/Microsoft/” directory is probably not code that you are working on yourself. With version control, it … Read more

How do you create a remote Git branch?

Simple Git 2.0+ solution: As of Git 2.0, the behavior has become simpler: You can configure git with push.default = current to make life easier: I added this so now I can just push a new branch upstream with -u will track remote branch of the same name. Now with this configuration, you will auto-guess the remote reference to … Read more