changing commit message after push from android studio - android

Please can any one help me how to change commit message after push from inside the android studio.I am using android studio in the windows OS.I know there is git push -f origin command but as I already told you I am pushing and making changes from android studio itself.It would be great if anyone can help me with this.
Thanks in advance!

Once you push the changes its considered final.
So if you have already pushed you can do this.
git reset --soft HEAD~1 (Pushes back head 1 back with you changes in the current head as uncommited change)
Now do a commit(appropriate message, no push) from android studio.
Now do a
git push -f origin branch
from the folder.

Related

how to fix Commit to git failed due to network

I added files to git git->add in android studio, files were added successfully. When I pressed commit and push, it was interrupted due to network issue. And nothing was pushed to git.
Now When I'm trying to add and commit, it ways nothing to push.
Kindly advise how to fix this in android studio.
Thanks in advance.
Your files already committed in your local system. Thats why you are unable to see any files when committing again.
To push the committed code, Goto VCS -> Git -> Push, You will see all the committed files, So you can push it to repository.
Alternative Terminal way,
You can also execute this command in terminal to push your code to master
git push -u origin master
Hope this helps.

How to do push code to a second and separate GitHub repository in Android Studio?

I'm stumped.
My project has it's original GitHub repository.
I will have to push the Android project to a second repository.
How to do push code to a second and separate GitHub repository in Android Studio?
I see hints that it's possible, but I don't know how to initiate to new repository.
Regards,
You can do so by either editing or adding remote URL from terminal.
To add:
git remote add origin2 https://github.com/user/repo.git
To edit:
git remote set-url origin https://github.com/user/repo.git
Then you can push to another remote repository.
In Android studio, you can press Ctrl+Shift+K and choose where to push the commits.
Follow these steps:
Go to the android project directory and open terminal then.
1.git init
2.git remote add bitbucket https://github.com/xxx/yyy.git (bitbucket is name i have given. you can use anything like origin2 etc.)
3.git add .
4.git commit -m "first commit"
5.git push -f bitbucket master

Contribute on GitHub using Android Studio

I'm not new to using GitHub on Android Studio, but:
This is my first try to contribute to a sample project for Android on GitHub.
I did the following
I cloned the repository:
I made my changes
I committed my changes
I pushed my commit
And baam (here is the problem):
Why? What things did I miss?
(Don't forget, I have never contributed on GitHub, and this is my first time.)
403 indicates that you are not allowed to access the resource - you aren't authenticated with GitHub. To fix this, you should change your remote URL to a repository you have access to, then push your changes:
https://myusername#github.com/user/repo.git
From the command line you would need to do the following (Android Studio should automatically detect the changes):
git remote remove origin
git remote add origin https://myusername#github.com/user/repo.git
git push -u origin --all // prompts for authentication, pushes your changes to github
Your question has nothing to do with Android Studio, I guess if you try to push your changes through command line you'll get the same result. Read about Contributing to Open Source on GitHub.
First of all, to do a contribution:
You must fork the repository
Clone your fork version of that repository
Through the command line, navigate to your clone directory then add upstream version (original repository):
$ git remote add upstream https://github.com/fcannizzaro/material-stepper.git
You can check it using the line $ git remote, and you will see origin and upstream.
Make changes → commit them → then push (all of this happen on your repository (forked one), not the upstream).
Go and check the network graph for both the forked and original repositories.
Go to the GitHub original repository's link and click pull request.
Do as described in this image:
And fill the others field and click Create pull request
Thanks for Erik Carlsten's tutorials.

Git working in bash but not in Android Studio

I've recently encountered an issue with Git in Android Studio.
I have some projects in Android Studio, taken from a git repository (managed with Gitlab). Until some days, actions like Push & clone worked perfectly, but not anymore...
I can still push & pull from the Git bash, but not in Android Studio.
It give me the following log :
Git Pull Failed
fatal : Could not read from remote repository
The test button under Settings->Version Control->Git work, I've reintall the last version (2.6.4) and it show me the correct version..
I've try generate a new SSH key, import a project cloned with the bash... But nothing work..
Any clue of the problem ?
Thanks in advance
Ok, I've found the solution :
It was because since some days ago, I use Android Studio in Administrator mode, but my SSH key was in my user profile.
As I was using Git in Bash mode with my profile, it was ok. But Android Studio was looking for the .ssh in the Administrator profile, wich doesn't exist..
I use Android Studio with my profile again, and it work again

Phonegap won't pull latest version

I'm making some changes to a test app to see how it works, git + phonegap, and for some reason I dont think phonegap is pulling the latest code. I can see the changes on github, here's the public test: https://github.com/xxAndreixx/prueba
I'm making the changes to the index.html file in the www folder, and I'm trying to install the app after I pull the code and rebuild, on an Android phone and however I can't see the changes when running the app; idk if I'm running the wrong commands on git. What I do is: 1) git commit -m "msg" 2) git push -u master origin
IDK where I'm failing.
#Andrei,
are you pressing the [Update Code] button?
TIL: don't be stupid and follow the correct order while in the ROOT.

Categories

Resources