How to use GitHub for Windows 2.0 with non-GitHub repositories - github-for-windows

I just installed (as opposed to update) GitHub for Windows 2.0 and for the life of me I cannot find how to use it with non-GitHub repositories. In the past I have done this without issues using this guide. However with version 2.0 the layout has changed and I cannot find a UI to clone a repo that is not from GitHub. I guess I have to drop to the command line but I have no idea how to use git that way.

As you suggested, you can clone the repository with Git on the command line. To do so you can execute the following steps:
Start the Git shell (Start menu->GitHub, Inc->Git Shell on Windows 7, I'm not familiar with Windows 8 but I think it will show up when you type "Git Shell" on the start screen)
Make sure you are in the GitHub directory (C:\users\\Documents\GitHub). Otherwise use the cd-command to navigate there.
Use the clone command git clone user#domain.com:/path/repository.git with the clone-url for the project you want to add. (More information about cloning)
Start GitHub for Windows and go to tools and options->Options
Click Scan for repositories, if everything went right your cloned project shows up.
Make sure it is selected and click Add

Related

Egit: Right click not showing GIT commands

I can't see the GIT commands when using right click on any files in a GIT repository.
I'm using Eclipse-Luna, A fresh install, afeter trying different versions of EGIT.
Thanks,
Elyahu
Some screen shots of the preferences:
I can't see the GIT commands when using right click on any files in a GIT repository.
You must first share that local project in order to make it recognized as a Git repository.
See "How make Eclipse/EGit recognize existing repository information after update?",but don't forget, once shared, to close/reopen your project.
Then Git will be active on said project.

Rstudio: Changing origin for git version control of project

I originally set up git in Rstudio while enrolled in the Data Scientist's Toolbox course at Coursera. Unfortunately, I did this in my phd project. The repository no longer exists on github. I am now attempting to write my thesis in rmarkdown using knitr and bookdown. I would like to use version control, both to learn proper git workflow and to have a structured back up of everything I have done in my thesis. However, I have been unable to change the version control repository in Rstudio.
I am unable to change this in the Tools > Version control > Project setup > Git/SVN menu. The Origin: textbox is unchangable.
I tried creating a new project using the old phd project's working directory. This also cloned the version control settings.
How do I change the origin to accomplish what is described above?
Git, Github and Rstudio are different things. You could use git as local version control tools. You might connect your local repo to Github account which is based on git by push/pull. Rstudio just makes a user interface for git and supplies the function to push the repo into remote server based on git to make version control(not only Github, but also Gitlab).
So for your issue, if you do not want to pay for github for a private repo, all of your code would be public and I don't think it is good before your finally finished your thesis. But version control could be made locally with git only. Just use git shell to control the version.
However, as a student, github could support private repo here for you. Just register and find your student package. Then just remove the url for remote repo after you cd to your workdir in command line, use the following code to find your remote url(mostly you might fing origin):
git remote -v
Then use this to remove them:
git remote rm origin
Now you could use version control locally. If you want to connect this repo to your remote github private repo, use this:
git remote add origin https://github.com/[YourUsername]/[YourRepoName].git
RStudio would find this information about git and support your following operation. Project in RStudio is different with git, although project support git as version control tool. So you need git in command line or shell to solve your problem.
This can be done by opening /your.project/.git/config
and editing the remote origin line(s), e.g. changing from git to https.
Restart Rstudio & you'll be prompted for your github username & password.
This is what worked for me for migrating from github to Azure
Go to the top right Git window in RStudio and click on the gear. Now click Shell (to open the terminal there).
#remove origin
git remote rm origin
#add new origin like Azure for me via HTTPS
git remote add origin https://USER#dev.azure.com/USER/PROJECT/_git/REPONAME
#push your local repro
git push -u origin --all
#in my case put in the PAT password if you needed to generate one.
After testing, I found some clue
Actually Rstudio is not really smart about this setting
It will first search for the git file in the Rproject folder where your Rporject file is located
if it could not, then it goes up to the folder contains your Rproject folder
However, for version control you only need coding files while RProject may contains some big files like .RData some pictures etc.
I don't find a way to manually disrupt this logic flow, the only thing you can do is to delete the current git repository setting files(which is .git folder and 2 other git setting files), then Rstudio may ask you if you want to init a new one.

Eclipse EGit, working with forked project. Getting updates from the original project

Hello everybody I have this "big" and frustrating problem,
I have forked a project from git and as usual it is available in my account in GitHub. I then set up a project in eclipse selecting from an existing URI. All is ok, if I work with my own version of the project.
What I want to do is, because the project is changing and growing day by day, to have an updated copy from the original project and, every time I want to download any change I would like that the download is from the original project.
At the moment the only way (with EXTREMELY big problems) I found is using "Team > Fetch from Upstream" the changing the link to the repos using the "config" button. Obviously this lead to conflicts and annoying problems. I am sure that this is not the correct way to handle a forked repos and I need help.
I am using windows 7 and eclipse with egit, if I press Windows-R and then cmd it don't recognize the command "git" so I can't use console commands.
Any help?
With windows 7, you can install git to your machine and use console command as normal. (Link to download)
See this link to configure git to sync your fork with the original repo.
Hope this can help.

Newbie Unable to clone repo

I've never used a VCS before and I'm attempting to set one up now.
I'm doing some Game Development with Unity3d. At first I googled how to set up VCS for Unity; and I found this: http://www.gamasutra.com/blogs/BurkayOzdemir/20130303/187697/Using_Unity3D_with_external_VCS_Mercurial__Bitbucket_step_to_step_guide.php
I followed it until it came time to clone the repository from within the hgTortoise workbench. When I hit the clone button after copying and pasting the URL to my repo from the BitBucket.org website I received an error: "Repository Git clone https:://username#bitbucket.org/username/projectName.git not found code: 255" and I do understand what an HTTP 404 error is.
Anyone who has used the internet knows it means the page could not be found.
I created this repo as private; is that why it could not find my repo?
Then I proceeded to follow the instructions at BitBucket's "BitBucket 101" help page. I installed Git, had already created a BitBucket account and repo, and the instructions which followed.
I stopped at the point where the help page said to enter some command line things in to Git Shell. I'm running Windows 8.1 and searches have shown me that particular program doesn't exist on this PC.
Am I doing this correctly? What am I doing wrong? All I need is to set up a VCS.
Git and Mercurial are 2 different distributed version control packages. They both use a command line interface. TortoiseHG (the package referred to in the step-by-step you linked to) is a GUI extension that's only used for Mercurial. (HG is the chemical symbol for Mercury, get it?!)
Bitbucket is an online repository that can host either Git or Mercurial repositories.
It looks like you created your repository on Bitbucket as a Git repo and not a Mercurial repo. Just delete the repo on Bitbucket (make sure you have a good copy of your source code) and recreate it as a Mercurial repo. Then work with TortoiseHG as instructed in the step-by-step.
The fact that it's a private repo doesn't matter. That just means it will only be visible to you (vs. everyone) and will require a password to push and pull changes via https or ssh.
Well, first of all, it seems that the tutorial that you seem to be using is based on using Mercurial instead of Git.
If you're comfortable with diving into the command line, you can download TortoiseHG, which is a Windows shell extension: http://tortoisehg.bitbucket.io/
However, there's nothing wrong with using SourceTree as well, which is a GUI-based interface for dealing with both Git and Mercurial repositories: https://www.sourcetreeapp.com/
FYI, if you downloaded Git for Windows, it should've provided you with a terminal called Git Bash that you can use for Git commands.

Do you have to install Git separately from GitHub for Mac?

I am a novice coder and I write a blog about learning to program aimed at journalists.
Learning the basics of how to use a version control system was one of the best things I learned this year, and I am now writing a tutorial about it.
Here is my question:
Do you have to install Git separately from Github's graphical client, GitHub for Mac? If it's possible to avoid command-line operations, I may choose to write the tutorial just focusing on downloading and installing GitHub for Mac and walking the user through the process of making new repos, forking, rolling back, etc.
Yes, if you want to do any git stuff on the command line, you'll need to install it. You'll especially want to do it because Github for Mac doesn't let you do everything you need to out of the box. For example you can't do a push without commit everything which can be annoying if you need to push a feature quickly without branching. Also, it is good for learnings!
You'll find an easy shortcut to install it under the "Github" menu: "Install Command Line Utility..."
You now can, (May 2013) install git directly from "GitHub for Mac"
See the blog "Installing Git from GitHub for Mac", you can install only the GUI, or the GUI and a regular git CLI (Command-Line Interface)
you can now easily install Git for use on the command line, without needing to download any separate packages.
When there is a new release of git, you don't have to do anything:
And whenever we update the version of Git included with GitHub for Mac, you'll get the changes automatically – no work required on your part!
There is a new "Advanced" option:
you may notice some changes to the Preferences window.
On the newly renamed "Advanced" tab, simply click "Install Command Line Tools".
You'll be prompted for an administrator password so that Git can be installed into /usr/local/bin, and then you should very shortly see that it succeeded: