How to check git repository url of project in eclipse? - android

See every time to check repository url I have to go under .git folder and check config for repository url.
Is there any way to check the project repository url from eclipse.

(June 2014) See the section "Remotes Repositories" or the EGit manual:
The "Remotes" node allows for browsing and editing Remote configurations.
Each Remote configuration has a name and either a Push Specification, a Fetch Specification, or both.
If a "Remote Configuration" node or any of its children is selected, the Properties view will show a summary of the Remote configuration.
You should see the url of the upstream repo in the Git Repositories view:
Note that, in command line, instead of getting in the .git/config directly, you can type:
git remote -v
Update October 2016, with Git in Eclipse:
As mentioned in the "Pushing to other Repositories", you also see the remote url with the "Configure push url" dialog:

From the package explorer view: right click on project you are working on =>Team=>Remote=>configure push to upstream.
You should now see the remove URL
Note: This is for Eclipse Neon release

Related

How to add an Android Studio project to GitLab

I referred this link:
Connecting to GitLab repositories on Android Studio
In step 1, I am getting this
https://gitlab.com/pvijayalakshmi/eemployee.git
In step3, I am getting this error:
Remote URL test failed: Unable to find remote helper for 'https'
Why I am getting this error?
Please help me.
Any help would be appreciated.
You can follow a tutorial from Github, the principle is the same: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
Basically, you need to add git to your local project, commit all the changes and set up remote repository URL:
git remote add origin remote repository URL
Then you push your code to the remote repository.
You can create a project to Gitlab manually, Get project repo URL &
Clone the project locally by using the terminal. One last step Now add your files in the local folder.

Can't push an android studio project into github

I had some existing repositories on github and i deleted them, now i want to reshare my project into github the android studio but i get this error
JustJava2: failed with error: fatal: repository not found
How can i make android studio to create a new repository and push the project their?
First, please check the github repo URL in android studio.
Android studio -> click Terminal -> input the command git remote –v to check the github repo URL you were working.
Assume the URL you found is https://github.com/username/r2 (or https://github.com/username/r2.git).
Then create a new repo with the same name (such as r2).
Click + icon -> New repository -> name the same repo name (r2) as you found in above step -> Create repository.
If you have already create a new repo with different name or there is no output for git remote –v in the first step, you can set remote url in android studio terminal by git remote set-url origin <the new created repo URL>.
Now you can push your project successful in android studio.
Have you created a new remote repository and updated the local repos remote url? You can see how to change the remote url from the command line here

Android Studio Git Push Rejected

I'm trying to uploading my Android Project on github but I get this error when I try to push:
Push rejected: Push to origin/master was rejected
I made this steps:
VCS->Import into version control->Create new repository...
From the git bash in Project folder:
git remote add origin https://github.com/[username]/[project_name].git
Git->Add
Git-> Commit directory
Git-> Push
after push follow these,
VCS --> Git --> Branches
then select origin/master --> Rebase
after finish rebase successful message, you could able to push to remote directory.
As suggested in the comments you should pull the changes first, if you are working on a new repository that could happened when you create your remote repo with a readme or a licence file. To pull the changes from the user interface you should use, VCS > Git > Pull then select the master branch (depends)
after that you can Git > Push without problem.
Just go to the root directory of your project and follow below steps:
Right Click-> Git Bash Here
Type git init (For initializing git).
Type git add -A (Get all files in the staging area).
Type git commit -m "First Commit"(Commit Changes)
Type git remote add origin https://your_git_url.git (Your repo URL)
Type git push -u origin master(master - Branch name)
OR
Type git push -f origin master(master - Branch name) (-f for Force push and make sure there are no changes in your branch to push code.)
You can also make use of Git GUI client:
Github Desktop for github users Download
GitKracken for Windows, Mac and Linux Download (Free for public repositories)
SourceTree for Windows and Mac Download
For Android Studio if your "Push" is rejected, go ahead and try this:
Try to Pull.(Origin/Master).Right after that:
VCS-->Git-->Branches..-->Remote Branches(origin/master)-->Rebase Current onto Selected
This will eradicate all your contradicting configurations.
Try this
This type of error was also coming in my project because i have create a new project and paste my old config and some classes file in new project.
I have pushed the code by creating new branch
Go to VCS->Git->Branches->New Branch
If none of the above solution works then you can check this out..
Log in to the GitHub account and go the settings.
In settings open Emails section and check whether it is public or private.
If it is public then other solution will work out finely and if your email is private then declare it public.
Because of the private email you aren't able to push the files in the repository from your IDE. So, make it public
Another Solution.!!
The unversioned code is not versioned, the changes are committed but don't push.
Following are the steps to make the files versioned.
Open the project tab(must be in the left side toolbar, if not then press 'Alt + F1')
At the top, there is a dropdown with 'Android', open the dropdown and select the 'Project'
In the list shown, right click your project folder
There must be a option of 'Git', select it
Choose the 'Add' option.
And there it is!.
Now simply try to commit and push operation as usual.
**NOTE :**You've to add files everytime using the above steps to upload the files successfully.!!
Thank you folks :)
I had this same problem. I finally tried it from the command line and and received this message:
remote: error: GH007: Your push would publish a private email address.
remote: You can make your email public or disable this protection by visiting:
remote: http://github.com/settings/emails
There you should see two checkboxes. You will need to uncheck one of them.
Keep my email address private
Block command line pushes that expose my email
This is the case when you make a repository with a readme file default and so you can either pull first or make a new repository without a readme file and dont forget to change the repo URL. Hope it helps. Cheers.
I had the same problem, just solve it by doing this:-
Go to Github account settings
(1)
(2)
I had the same issue when I Fork from my another github account and clone it in Android Studio, I changed some file and commit(success) and pushed and that is rejected.
The problem was, I have logged into GitHub in Android Studio with my other account, not the one I'm fork the project. Check out your's from:
File -> Setting -> Version Control -> GitHub
If account information is not match with the repo cloned account, change it.
Then you can Push without a problem.
We can get around this "limitation" by editing the .git/config on the destination server. Add the following to allow a git repository to be pushed to even if it is "checked out":
[receive]
denyCurrentBranch = warn
or
[receive]
denyCurrentBranch = false
If you are pushing for the first time, Delete the repository from git, Share the project again on Git from Android Studio 3
When I encountered the same error in Android Studio; I just simply renamed my remote name and it fixed the error.
Steps which I followed are:
Right click on project name and go to Repository option.
Then select Remotes.
Then you will be asked to Define Remote by providing a name of the remote and URL of your GitHub repository. Just change the name according to your choice if 'origin' is already filled and then fill the URL of your GitHub repository.
I am giving clear note here skip steps you already done..
first create new repository in github. (dont close the tab until work done)
then you have to check whether you are log into your github account in android studio. if not you can log in setting-->Version Control --> github.
Then go to VCS -> Import into Version Control.
now in android studio project tab change it from android to project .Android to Project.
step 3:
then Right click on your project select git then +add. again Right click -> commit and again Right click -->git--> repository--> push.
in the new window select origin ->master then push.. if you already do this part and get the error in here do this.(i think this is the first time you try to add your project to github and github repo is empty.)
goto terminal (bottom of the ide) remove origin using this command.
git remote rm origin
now do step 3 again. after that you will asked to enter github repository url.
whenever you add url make sure to add .git .at the end of the url.
like this. https://github.com//xylophoneApp.git
for anyone maybe Suffers with this issue like me, the entire problem was with executionHistory.bin file, and don't ask me why because I don't know at all.
just create commit without this file and push it, this was the solution for my issue.
Hope this help someone.
In my case initially, I had created a new repository with a Readme file.That's causing the issue. Next time when I create new repo without the Readme file, everything works fine

Change bitbucket repository name on local project

Im using Android Studio with bitbucket. I changed the name of a repository and now when I try to push, I get the message Fatal error, repository not found.
How do I update the new repository name on my Android Studio Project to push correctly?
Thanks in advance.
See my example:
Go to terminal,
cd projectFolder
git remote -v (it will show previous git url)
git remote set-url origin https://username#bitbucket.org/username/newName.git
git remote -v (double check, it will show new git url)
git push (do whatever you want.)
See my example:
I simple changed the repository name accessing the config file inside the .git folder of my project. That solved the problem.
Update your git remote, changing the repo url: https://help.github.com/articles/renaming-a-remote/

How to add an already existing branch in an already existing Android Repository on Eclipse

So I have imported an Android project using the Git import. When I imported it I added all of the Remote branches. But since then some other branches have been added to the project. I am trying to add a branch that was added using GitHub into my Eclipse Git Repository-> Branches->Remote Tracking. How can I do this?
So what solved the issue was:
On Project in Git Repositories View:
rightClick Remote->Fetch
On Branches
rightClick Switch To -> New Branch. . .
Source: Select [Branch of interest]
Branch name: [same as remote branch name, this is the local branch name]
click Configure upstream for push and pull
click Rebase commits of local branch onto upstream
click Checkout new branch
Finish
As mentioned in the Egit manual, "Remote tracking branches are created automatically when cloning and fetching from remote repositories."
So after your fetch, you can click on the create Branch icon and create a new local branch based on origin/newReoteBranch name.

Categories

Resources