How to Open my GIT REPO in VS CODE in Linux - linux

I have installed the VS Code by following the VS CODE site.
Now I want to use it to open my git repository to edit files.
Installation is completed on Linux.

Clone your repo first to a local directory.
Open VSCode.
Select 'File-->Open Folder' and select the cloned folder.
The files will be shown in the side bar.

Related

Why does the git client open local repositories in the /run/ folder?

I have a repository in a folder /var/www/. Through the git client, I select this folder as "open an existing repository", but the repository opens as if it is located in the /run/ directory.
This did not happen on the old computer. And now I have a number of problems. For example, auto-updating of the state of files after their modification does not work. It also fails to use Stash. There are also other problems.
UPDATE and a solution: I found out that this problem appeared due to the fact that I installed the flatpack version of Sublime Merge on
a new computer. When I reinstalled it as a regular package, everything
works as it should.
I'm not sure if the problem is exactly in the changed repository path, but this is my main suspicion.
I'm using Linux Mint 21.1. Test this with git-clients Sublime Merge and Gittyup. Sublime Merge shows the path to repositories as /run/user/1000/doc/c9e48011/<repo_name>.
Gittyup as /run/flatpak/doc/c9e48011/<repo_name>.
On the path from Sublime Merge, there really is a folder with all the files from my repository. And the path that Gittyup shows is inaccessible because the /run/flatpak/ folder doesn't actually exist.
Why is this happening and how to fix it?

Android Studio- git Clone: "Unable to create destination directory"

I am trying to clone a github repository from my account in my Android studio, but each time I try to clone it by
VCS -> get from version control -> URL, an error message pops up with message:
"Clone: Unable to create destination directory".
What can I do?
Go to your Android Studio installation directory (usually Program Files/Android/Android Studio).
Go to the bin folder.
Right click studio64.exe (or studio.exe if you're using the 32bit
version) and run it as an administrator.
Now clone should work just fine.
I'm sure there is a better solution out there but right now, this should work.
Check your folder path.
In my case, my directory name had whitespace, so I changed the folder name from namu nikam to namunikam.
After that, github cloned the project.
The project error message was:
Cmd doesn't allow us to run commands with any space in between
Sometimes we use underscores between words, like namu_nikam.

Failing to upload a copied(then renamed) android project back onto Github from Android Studio

I duplicated a local copy of an Android project on my PC from File Explorer. This project was already uploaded onto GitHub successfully. I believe I followed the steps to rename/refactor the copy to a new name. The package name and app name all display the new name I want.
However, when I attempt to share it back on GitHub, it says it already exists (displaying the previous app name).
Not sure how to get my local, renamed version back on Github as a new project and not overwriting the previously named version.
find a hidden folder inside your project, having name .git delete it and then share your project to github.
There is config file inside .git folder, may be that having address of your remote git project.
There is no need to delete the .git folder: that would lose the history!
Simply create an empty GitHub repo, and on your local copy, do
cd /path/to/local/copy
git remote set-url origin /url/new/empty/github/repo
git push --mirror
You don't have to rename the parent folder of your local copy, or rename anything: just make sure its default remote upstream repo "origin" references now your GitHub repo.

Copying file from desktop to remote repository on SVN

I am extremely new to SVN, I am using SVN on Mac OS terminal. I have a file on my laptop that I want to transfer to my repository on my remote server.
This is what I have done:
I have checked out the repository. It says "checked out revision *".
I have used cd until the folder that I want to insert the file. So at this point I have a path like: (...../src/soln$) so I want to insert the file in the 'soln' folder.
When I try:
svn add ('...../lo.java') (the path to my file on my computer) it says:
('....../src/soln/') is not a working copy
svn import ...../lo.java it brought something weird to the screen
Please help me figure out what I am doing wrong or not doing.
The error indicates that the parent is not yet in svn. Try to svn add each folder above lo.java.
As an example if the repo root is at /path/to/my/repo and your file is in /path/to/my/repo/src/soln/lo.java then you'll not only want to svn add lo.java from inside the soln directory, but you'll also want to svn add /path/to/my/repo/src and then svn add /path/to/my/repo/src/soln before you can perform the svn add lo.java

Configure Android Studio with Bitbucket team repo

I am trying to configure Android Studio to work with my team repo on Bitbucket. What I would like to do in the first place is to push my local project onto my team's repo.
I have already installed the Bitbucket plugin but don't really know where to go from here. When I try to commit the changes, all I get is "No changes detected".
Without Using Any Plug-in
First from VCS menu of android studio select Enable Version Control Integration, it will ask you for selecting versioning tool, select git from the drop down.
Create new repository in the BitBucket account for the project, selecting git as the repository type.
Now from the terminal window at the bottom of android studio, type: git add -A
This will add the files to git for committing.
To commit with a message type git commit -m "First Commit" in the terminal. Here, First Commit is just a message i used for demonstration.
From Bitbucket, in the newly created repo, select I have an Existing Project from below. It will give you two command line commands. Use Them consecutively. These will add the local repo to the bitbucket. First one: git remote add origin https://example#bitbucket.org/example/test.git
Second one:
git push -u origin master
Add again git add -A
Then Commit git commit -m "Second Commit"
Push for the last time git push origin master
You can check that the branch is up-to-date by writting git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
Done .
My Android Studio version was 2.3.3 & git version 2.13.0.windows.1
So I am assuming you have a local project and you need to import it into your Repository in BitBucket. Since you already have the BitBucket plugin installed, follow the below steps:
Goto VCS Menu > Import into version control > Share Project
You will have to give your credentials when prompted.
On the next dialogue, give a name and a description to your project and then click OK
Now you have got your project imported to BitBucket. Now to checkout a project from BitBucket:
VCS > Checkout from version control > BitBucket
Select the project you want to checkout
After you have added the project to BitBucket, you will see a menu called Git in you VCS menu, which has all the options of Git.
Now depending on the version of android studio and the BitBucket plugin you are using, you are likely to get some errors while doing these. I did these using Android Studio 0.8.2 and Bitbucket plugin version 1.2.2.
Also make sure in the Android Studio Preferences > Version control, the directory is set to <Project> and the VCS to Git. Unless you are using Mercurial or anything it is advisable to remove any VCS other than Git from there. If all these are right everything should be working well.
There is a bug in the third-party Bitbucket plug-in which is preventing it from working, although you can still configure Android Studio to work with Version Control.
Create a repository on Bitbucket.
Clone it via VCS > Checkout from Version Control > Mercurial or Version Control > Git.
Use the HTTPS or SSH URL shown in the "Clone" tab for the repository on Bitbucket as the Repository URL.
Copy and paste your local project into your cloned repository.
You may now use Android Studio to work the repository.
Android Studio -> VCS -> Enable version control
Right-click on your root directory -> select git -> Add
Then click on ctrl+K
Write your commit msg
Click on Define Remote
Paste your git repository url.
PUSH
//Easy tutorial on android studio with bitbucket (linux)
create bitbucket repository "testp"
create a folder "gtest" on your local machine
go to this local folder("gtest") with cd command
now clone git repository "tesp" with clone command
this repo "testp" folder must come inside that "gtest" folder now
open android studio and create a project "MyApplication" by selecting the project location folder "testp"
now open terminal and go to path with cd command upto that tesp folder (you can use terminal inside android studio)
now hit ls command and it should show your project dir "MyApplication"
on your terminal type command "git add MyApplication/".
10.now enable vcs by clicking menu on vcs and enable vcs ...
once the vcs is set or enable then select your appliation "MyApplication" project >> right click >> git >> commit directory >> may write comment "initial commit" and hit "push and commit" button.
see event log for more detail
check out the repo it should be there.
if you have to pull this project only then goto "MyApplication" project >> right click >> git>> repository>> pull
Note: here "testp" , "gtest" and "MyApplication" are only example
If you have already android project then
select menu(vcs) check out from version control
click clone and copy repository from bitbucket and paste it on dialog given by selecting menu1
On the second menu provide specific location where you want to clone
After clone is success it will ask something like create project, anyways click yes.
Now project is created
6.right click on the project and clik new> add module > import project(this is where you import the already existed android project)
7.After every thing is done, build.gradle may have build problem ,if occur paste following code :
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
now cd up to your bitbucket clone folder using android terminal
now add everything inside this folder using git command "git add file1 file2 file3"
And lastly right click on your project and goto git>commit directory> commit and push and its done
11.You have your code push and commit on bitbucket : check it out
done
// clone on other computer
clone the bitbucket project using vcs option
and load project(not import) after it get clone
if this not work:
vcs clone to desired directory((click no ,if it ask something like yo have check out an android studio project..Would you like to open it)) and import the project using exact same location of clone directory(use gradle wrapper if asked : it may download so wait) and lastly enable vcs for push and commit.
Here is what you can try.
Android Studio -> VCS -> Enable version control
Android Studio -> Changes
Review all files and commit. At this stage you might have to add your files
to VCS manually.
Now you can share it on Bitbucket by
VCS-> Share it on Bitbucket
Note:- For bitbucket you will have to install "following Bitbucket plugin"
for Android Studio. http://plugins.jetbrains.com/plugin/6207?pr=androidstudio
You need to add the files to your local repository first.
Go to menu VCS -> Show Changes View.
Add all the files.
Then got to menu VCS -> Import into Version Control -> Share project.
You will be ask to enter the bitbucket origin URL. And that's it.

Resources