Commit an entire Netbeans project on sourceforge - netbeans

I have my own PHP project in NetBeans. Afterwards I have registered a sourceforge account. Now I would use sf's git repository for versioning my code.
What I need now is to send the entire project on the repository, using netbeans. How can i do that?

Assuming you are on SourceForge's latest platform i.e. Allura, you first need to create a Git repository on SourceForge.
(You might have already done this when you first made project)
Following are the step to create git repository on it.
1) Log in to SourceForge
2) Go to Admin
3) Click on Tools
4) Click on Git. At this point, it will ask for Label and mount point for it. Enter those information. Once you finish it should create a new tab on top menu with whatever label name you provided. Let's say you named it 'Code' for now.
5) Click on 'Code' label and it would show you following instruction to push the code.
// First time using Git
cd <your_local_project_dir>
git init
git commit -a -m 'Initial commit'
git remote add origin ssh://<your_sourceforge_username>#git.code.sf.net/p/<your_project_name_on_sourceforge>/<mount_point_name_you_provide_in_step4>
git push origin master
// Existing Repository
cd <your_local_project_dir>
git remote add origin ssh://<your_sourceforge_username>#git.code.sf.net/p/<your_project_name_on_sourceforge>/<mount_point_name_you_provide_in_step4>
git push origin master

I think you might want to take a look at NetBeans' Git support;
http://netbeans.org/kb/docs/ide/git.html#initialize
It's built into the IDE so there's no plugin to install.

Related

Jupyter Notebook file is taking forever to upload on Github

I was trying to upload one of my Jupyter Notebook files on GitHub, but it's taking forever to upload.
File size is also not that big. It's about 17KB. Also getting problem for this notebook only.
Here's the screen shot.
Any kind of help or suggestions are highly appreciated.
Try using Git Bash to push your code/make changes instead of uploading files directly on GitHub (it is less prone to errors and is quite comfortable at times - takes less time as well!), for doing so, you may follow the below-given steps:
Download and install the latest version of Git Bash from here - https://git-scm.com/
Right-click on any desired location on your system.
Click “Git Bash Here”.
git config --global user.name “your name”
git config --global user.email “your email”
Go back to your GitHub account – open your project – click on “clone” – copy HTTPS
link.
git clone PASTE HTTPS LINK.
Clone of your GitHub project will be created on your computer location.
Open the folder and paste your content.
Make sure content is not empty
Right-click inside the cloned folder where you have pasted your content.
Click “Git Bash Here” again.
You will find (master) appearing after your location address.
git add .
Try git status to check if all your changes are marked in green.
git commit --m “Some message”
git push origin master
Hope this helps! Good luck!
You could try and:
clone the repository, add the file locally, commit and push
check on github.com if your remote repository has a .gitattributes file with lfs directives in it.
Maybe that repository, managed by LFS, has reached some upload limit which would prevent any new upload.

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.

How to check out a project from a server with Git

You may classify my question to the layman's level, but I am using Git for the first time (til now I used TortoiseSVN) and I am not sure how I can check out an existing project from a server, so as to have it available on my local machine in a folder. I have installed Git Bash. Should I run it (Gui), select New Archiv and then specify the path of the project in the server? Is there a better Git framework to install, which is appropriate to make the same task more easily?
I would appreciate also some screenshots if needed in the answers.
Update: I have installed also TortoiseGit. I want to create a new clone by a right click in a directory, but the new Clone is not available after the right click. Does it need additional configuration? If no, what should I do from TortoiseGit to checkout an existing project?
I'd usually recommend learning git from command line. But if you are already familiar with TortoiseSVN then TortoiseGIT is a good tool for you.
Also, I think you should learn git very well. I can recommend the book Pro Git.
To "check out" a git repository is called clone in the git world (you will get a whole copy of the server repository). This can be done either from command line or TortoiseGIT.
git bash:
$ cd /path/to/my/projects
$ git clone url-to-server-repo
Update:
Since you get the "normal" TortoiseGit menu (without clone option), it seems you already have a local git repository. You probably created an empty git repository by mistake. Look for a hidden directory .git in the project directory or any parent directory.
right click on the folder (not right click on nothing in the folder, the icon of the folder you want to clone INTO from the parent directory) and select clone from the menu.
FYI:
clone = create a copy of a repository.
checkout = change the current state of an existing repo to a saved state.
so if you have a repo w/ 3 commits (A,B,C) when you clone the repo you will be at the most current state (C). if you want to see the previous state of the repo you would git checkout B. if you want to see the repo's initial state you would git checkout A
hope that helps.

How do I configure Git in Xcode to work with BitBucket

I have a project which I have been on for ages which is not connected to any source code repository.
I want to start using BitBucket now, however I am not sure how to go about it. I have created a project in BitBucket.
Should I now clone and check out in Xcode or should I add a repository in xcode. Anyone have any idea?
I have tried cloning using the URL from bitbucket but it just comes back with an error in Xcode
I've met the same problem and here's how I solved it:
(Assume your project is not already under local source control) Create a new project under LOCAL source control (Please note that adding remote source control at this stage may not be successful)
Make this new project a clone of your old project - drag files, add frameworks, etc.
In menu "Source Control" -> -> "Configure "
In the new window, click on "Remotes" -> "+" -> "Add Remote"
Name: anything (you can use "BitBucket")
Address: https://accountname#bitbucket.org/accountname/reponame.git
"Source Control" -> "Commit"
Select "push to remote" at the left bottom corner
Click "Commit"
Check on BitBucket website to see if it's actually pushed to it
As of 2017, xCode now automatically creates repositories for new projects. To push to a new BitBucket repo, go to 'Source Control' > 'Commit...' in xCode and make your first local commit.
Next open a terminal and navigate to to the top-level directory of your project. If you ls -a in here you should see the .git/ directory has been created. In the same directory, add your remote repo with the following (replace with your username/team name and repo name):
git remote add origin https://USERNAME#bitbucket.org/USERNAME/REPO_NAME.git
Go back into xCode, go to 'Source Control' > 'Push...'. You'll be prompted to enter your BitBucket password. Press OK and you're done! Source control commands will now be working within xCode.
I did that through command line and it is fairly straightforward.
create a new repo on bitbucket
assuming your xcode project is not under local git version control yet
go to command line, cd to your xcode project directory, and the follow the bitbucket doc: https://confluence.atlassian.com/display/BITBUCKET/Import+code+from+an+existing+project
git init
git remote add origin git#bitbucket.org:<user_id>/<repo>.git
git add .
git commit -am 'init commit'
git push -u origin master
go back to xcode and you should be able to interact with bitbucket through xcode from this point on
Using the following URL structure
https://accountname#bitbucket.org/accountname/reponame.git
(Taken from here) did the job for me
It is easier to:
create your local Git repo through XCode and add your code there
in command line, add the remote 'origin' toward your BitBucket repo, along with your ssh credentials (in ~/.ssh/config): see
"Bitbucket + XCode 4.2 + Git".
"Using the SSH protocol with bitbucket"
do at least one "git push myrepo origin master" to initiate the first push
This link helped me, I will also copy and paste the instructions in case the link goes away.
http://sketchytech.blogspot.com/2016/02/send-xcode-project-to-bitbucket.html
Sending a non-git Xcode Project to BitBucket from GitHub is the most popular place to host your repos but if you are looking for a free service for teams that are 5 members or less then take a look at BitBucket. Here are instructions for moving a local Xcode project onto BitBucket. (Note: if you opted for a local Git when you created your project you should be able to skip steps 3 and 4.)
-Sign-up for BitBucket and create a repo
-In Xcode go to Source Control menu
-Select "Create a working copy ...."
-Select project and press Create in dialog window
-Return to Source Control menu and select -> Configure ...
-Click "Remotes" tab
-Press add "+"
-Copy and paste the https address you see at the top right of your repo page into the remote location in Xcode
-Go to Source Control menu and select Push... to upload the project
Pushing code updates to BitBucket
Now you have it set up whenever you want to push code to the project:
-Go to Source Control menu and select Commit
-Write a commit note and uncheck anything not to be included in the commit
-Return to Source Control menu and select push
-Select the correct branch and Push
Pulling code down from BitBucket repo
To get code provided by others down from BitBucket:
-Go to Source Control menu and select Pull.
I use SourceTree and Xcode 6.1 and in my case I first create a repository on bitbucket, then I clone my repository on an empty folder (using SourceTree or via command line) then when you create the new project on XCode in that folder, you can commit push and pull normally from XCode
I found this youtube video and it helped me a lot, used this Atlasssian help for ssh authentication, and encountered an Xcode problem for which the solution can be found in this page.
Most simplest way is go to
Xcode > preference > #accounts > click '+' button on corner left
... then this popup will appear ...
just click Bitbucket Cloud ...
Enter ID with password...
And that's it...