Do we need local server to clone a repo from cloud in plasticscm - plasticscm

Do we need local server to clone repo from cloud. I tried to clone using cm clone repo1#<organame>#cloud It gives me error
Source and destination repositories are the same
('repo1##cloud')
. Can't we just clone a repo like we do in git using "git clone" and it just copy the floder to disk.

The "cm clone" command requires a src_rep_spec and dst_rep_spec parameters as it clones from a source to a destination repository.
More info on cm clone --help.
if you just want to download a copy of a repository in certain changeset you should use you should use "cm wk create" (Create a workspace).
More info on cm wk create --help.

Related

Azure DevOps - Moving TVCS Repo from one tenant to another - 2021

Before posting this question I have looked through all the similar ones. Finding no workable solution I am asking for help.
Thanks in advance!
I am trying to copy the repository from one tenant to another one using the following approach:
(done) Download the tool: Download Microsoft Git-TF for Visual Studio Team Foundation Server and Visual Studio Online from Official Microsoft Download Center
(done) Download Git-TF and Git-TFS (done with using git-tfs)
Clone an existing TFVC repo to my local machine as a Git repo using the Git-Tf tool: git-tf clone https://dev.azure.com/myorg/ "$/mysourceteamproject/mysourcebranch" --deep git-tf is no longer supported so I used git-tfs here. git-tfs clone https://dev.azure.com/myorg/ "$/mysourceteamproject/mysourcebranch" --deep
(done) Cd into the directory that the code was cloned into and push the local Git repo to any empty remote Git repo (this will be used as a temporary repo during the migration) git remote add origin https://user#dev.azure.com/myorg/anyteamproject/_git/tempgitrepo git push -u origin –all
(done with using git-tfs) Cloned the temporary Git repo to my local machine git-tfs clone https://user#dev.azure.com/myorg/anyteamproject/_git/tempgitrepo
(done ) Created an empty new folder “migrated” in the existing target TFVC repo (done with git-ft but from this step I am not sure it is a correct approach now) Cd into the directory that the code was cloned into, and run the configure command: git-tf configure https://dev.azure.com/myorg/ "$/mytargetteamproject/migrated" (here git-tf does not due to Basic Authentication issue as it is no longer supported. Using gif-tfs led to bootstrapping to the tenant we would like to copy from - to original )
Run the pull command to merge two repos does not work - git-tf pull leads to bootstrapping to the wrong tenant - git-tfs pull the steps below simply cannot be executed as the step 8 cannot be completed properly.
Run a basic git commit command git commit -a -m "merge commit"
Checkin to the TFVC repo git-tf checkin –deep --metadata
The question is - is there a way to move TVCS repo from one tenant to another TVCS tenant repo?
Finally, I managed - of cause not only me - to do migration.
Unfortunately, git-tfs could not be used as it works not as git-tf.
The main issue was Authorization step with using git-tf.
Using token name and token as user name and password accordingly helped a lot.
All the steps done can be seen below:
Install GIT, GIT-TF, Java
To clone source repository to local GIT
git-tf clone https://azerov:[source token]#dev.azure.com/OrganizationName "$/D365FOps_Learn02/Trunk" --deep
username: TestPatMigration (the name of the token)
password: [source token]
Create any remote GIT repository to push local cloned repo there
cd into cloned repo c:\users[curuser]\Trunk
git remote add origin
https://azerov:[git temporary target token]#dev.azure.com/OrganizationNameTarget/GitTemp02/_git/GitTemp02**
To push local cloned repo into temporary GIT repo
git push -u origin –-all
To clone temporary git repo to local machine
git clone https://azerov:[git temporary target token]#dev.azure.com/OrganizationNameTarget/GitTemp02/_git/GitTemp02
To configure the target TFVS Project to push local temporary GIT repo there
cd into c:\users\GitTemp2
git-tf configure https://azerov:[git temporary target token]#dev.azure.com/OrganizationNameTarget/ “$/D365FOps_learn02/Trunk”
git-tf pull
Username: PATMigration (the name of the target source token)
password: [git temporary target token]
git commit -a -m "merge commit"
git-tf checkin –-deep –-metadata

how to add existing non-git project to bitbucket

I created a project using angular cli. Project is in directory dw-ng2-app and it has several files generated by angular cli. I want to create a Bitbucket repository for this. My confusion is, when I create a repository in Bitbucket, it gives me 3 options
I create a README and .gitignore file. I cannot use this option as
then when I try to sync the local project with repository, I get
error that there is no common history
I selected option of starting
from scratch. The web page listed the commands I should run to clone
and upload, eg git clone git#bitbucket.org:username/angularcli.git
but this creates a new directory on my local machine named
angularcli which has .git directory. I am not sure if I can use this
option as my project is in different directory and moving it to
angularcli directory might affect it (not sure)
3rd option is to
mention that I have an existing project. Then I am prompted to use
the command git remote add origin
ssh://git#bitbucket.org/username/angularcli.git but that doesn't
work as my current project directory is not a git repository
How can I move the angular cli project to bitbucket? Should I have created the repository first and then created angularcli project in the generated directory?
There are a couple of ways to do this, but the simplest may be to simply make your current project directory, a git repository.
Go to your project directory
cd dw-ng2-app
Initialize git repository
git init .
Add your current project to be tracked
git add --all
Make your initial commit
git commit -m "Initial commit for Angular project"
At that point, you can use the third, "existing project" option within BitBucket.
After you've created a new repo there, you can see its URL and use that to track your new repository with your local one
git remote add origin https://username#your.bitbucket.domain:7999/yourproject/repo.git
git push -u origin master
[Here's a complete writeup from BitBucket if you need.][1]
note - I used git add . originally in my example, and BitBucket recommends git add --all. Either of these will work fine in your case.
[1]: https://confluence.atlassian.com/bitbucketserver/importing-code-from-an-existing-project-776640909.html
If you've created project using angulat-cli then it automatically created project with git initialisation. It also commits initial changes locally.
So you just have to add remote origin and push the content.
-If repository is not initialise as git repository then:
cd dw-ng2-app
git add --all
git commit -m "commit message"
git push -u origin master
-If already initialise with git repository.
First of all go to directory dw-ng2-app : cd dw-ng2-app
add remote to your repository.
git remote add bitbucket https://username#your.bitbucket.domain/yourproject/repo.git
push the changes:
git push -u origin master
here's master is name of branch in which you want to push the content.

How to sync the local folder with the Git Repository on NitrousIO

First - I've created the git repository and also created the local repo of the same on my local system.
Second - Worked on my local system and did some changes and pushed the changes on to the Git repository such that my local system source and git repository are in sync now
Now, Instead of working on my local system, I wanted to work on NitrousIO. Hence created the folder same as my git repository name and did 'git .init' as well. Basically this is the Ruby on Rails application, hence followed 'rails new RKsJobs_Board' to set up the folder and then git .init
What I need is:
As the remote git repository is up-to-date with the source code, I would like my NitrousIO folder to be in sync with the remote repository.
How can I achieve this ?
I tried this on Nitrous from the root directory like below:
action#rksrailszone-182221:~$ git checkout -- RKsJobs_Board
error: pathspec 'RKsJobs_Board' did not match any file(s) known to git.
I also tried this on Nitrous from the actual directory like below:
action#rksrailszone-182221:~/RKsJobs_Board$ git checkout -- RKsJobs_Board
error: pathspec 'RKsJobs_Board' did not match any file(s) known to git.
I know something fishy is missing to get it work but unable to find out myself.
Let me know if you guys can help..
If you just did a git init ., the local git repo is empty and has no index for you to checkout.
You would need to add a remote repo url
git remote add origin /url/to/remote/repo
git fetch
git checkout master origin/master (or) git checkout master && git reset --hard origin/master
That would give you the content of the remote repo in your local repo history and working tree.
Note - Before following the steps, please ensure to have the empty folder then start with git init . and other steps mentioned above

share git repo between two computers locally

I'm working on an Xcode project and my brother wants to start helping out. I have the .git folder in my Xcode project directory, how can my brother pull / push / commit to / from my computer? Do I have to use OS X server and put the repo inside of there, or is there a simpler way to do this?
One simple option is to enable "remote login" in sharing, which enables ssh, then you can use the ssh protocol to clone the repository. Remote login preferences will tell you:
To log in to this computer remotely, type "ssh username#computer.local".
username#computer.local will be replaced with your username and hostname. In terminal, use:
git clone username#computer.local:[path]
on your brothers computer to clone the repo to him, where [path] is the path to the folder containing the repository. You will need to enter your password, and you will need to enter it in order to copy changes back later with git push or whatever.
You can set up passwordless ssh with private keys, but bear in mind that by doing this you are effectively giving your brother entire control of your computer.
If you want to push code between two non-bare repositores, I recommend having a look at git-annex.
It is usually used for syncing large files between repositories, but it also contains a nifty way of syncing non-bare repositories (pushes go to synced/master branch that is automatically merged).
Basically, if one can write a ls path or ssh [user#]host:path ls command that would list your repository, then you can use the corresponding git clone [[user#]host:]path [optionalNewName] to clone from it.
Also if he (or you) is working on the same local machine, or has access to the local filesystem, one need only point to either the .git directory or the directory containing the .git directory.
To make clone a repository into another directory:
git clone . ~/2015Archive/repositoryB # copy pwd's repository elsewhere
git clone .git ~/2015Archive/repositoryB # same
git clone ~path/path/repositoryA . # clone other repository into pwd
git clone /home/brother/2015/projects/CoolProject ~/WORK/BrosCode
# with ssh from a remote machine
git clone me#brosmachine:/home/brother/projects/CoolProject WORK/BrosLameCode
git clone me#brosmachine:../brother/projects/CoolProject WORK/BrosLameCode
If you change into the target repository and do a git remote -v it will show you an absolute path to the 'origin' from which it was cloned. If it was a local dir, it will be just a plain, absolute path. If it was accessed through ssh, it will be a ssh [user#]host:path identifier.

How to upload a project to GitHub

After checking How can I upload my project's Git repository to GitHub?, I still have no idea how to get a project uploaded to my GitHub repository.
I created a repository and want to upload my project to it.
I've looked on the repository page for an upload button of some kind, but I haven't seen anything of the sort.
I've looked at the links provided so far, but I'm still getting nowhere. They mention command line; is that Windows command line or Git Bash? Because I can't get either to do anything.
I also tried using the Git GUI, but when I select the folder I want it says that it's not a Git repository...does it need to be zipped up? I tried adding the .gitconfig file in the folder, but it doesn't make a difference.
GitHub released a native Windows client which makes all the below steps redundant.
You can also use Sourcetree to get both Git and Mercurial setup on Windows.
Here is how you would do it in Windows:
If you don't have Git installed, see this article on how to set it up.
Open up a Windows command prompt.
Change into the directory where your source code is located in the command prompt.
First, create a new repository in this directory git init. This will say "Initialized empty git repository in ....git" (... is the path).
Now you need to tell Git about your files by adding them to your repository. Do this with git add filename. If you want to add all your files, you can do git add .
Now that you have added your files and made your changes, you need to commit your changes so Git can track them. Type git commit -m "adding files". -m lets you add the commit message in line.
So far, the above steps is what you would do even if you were not using GitHub. They are the normal steps to start a Git repository. Remember that Git is distributed (decentralized), meaning you don't need to have a "central server" (or even a network connection), to use Git.
Now you want to push the changes to your Git repository hosted with GitHub. You do this by telling Git to add a remote location, and you do that with this command:
git remote add origin https://github.com/yourusername/your-repo-name.git
*Note: your-repo-name should be created in GitHub before you do a git remote add origin ...
Once you have done that, Git now knows about your remote repository. You can then tell it to push (which is "upload") your committed files:
git push -u origin master
Follow these steps to upload a project to GitHub:
git init
git add .
git commit -m "Add all my files"
git remote add origin https://github.com/yourusername/your-repo-name.git
Upload of project from scratch require git pull origin master.
git pull origin master
git push origin master
git push --force origin master
if you have problems uploading!
Here I explain how I did it on Windows.
Make sure to install Git and GitHub.
After installation is complete, open Git Bash.
So a window like below is going to pop up:
Go ahead and type cd ~ to make sure you are in the home directory. You can check the address that you are in it by typing pwd;
Now you need to create a GitHub account. After creating a GitHub account, go ahead and sign in.
After you signed in, on the top right click on the + and choose “New Repository”
Then in the opened window, type the name that you wish to have for the repository in the “Repository name” box. Add “Description (optional)” if you like, and mark “Initialize this repository with a README”. Then click on “Create repository”.
Now go to your C drive; create a new folder and name it “git”. Now go to the “Git Bash” window; change the directory to c drive by typing cd ~; cd /c.
If you type ls there it would show you the folders there. Make sure it shows the Git folder there:
Now go back to the browser; go to your GitHub page, click on the repository that you made, click on “Clone or download”, and copy the address that shows there (by choosing copy to clipboard).
Now going back to “Git Bash”. Use the command cd git to go to the git folder; now write the following commands to connect to your GitHub (enter the username and password of your GitHub when it asks you):
git config --global user.name "Your Name"
And then: git config --global user.email youremail#domain.com.
Next type: git clone (URL), instead of the (URL), type the address of the GitHub repository that you copied from your GitHub page; (e.g., git clone https://github.com/isalirezag/Test.git).
Now if you do ls command you will see your repository there. If you also open the Git folder that you have in your window you will see that your repository is added as a folder.
Now use the cd command to go to the repository: cd Test
Go ahead and copy and paste any files that you want to put in this repository in that folder.
In order to transfer the files to your repository you need to do following now:
Type git
add filename (filename is the file name that you want to upload) or you can type the command below if you want to add all the files in the folder:
git add .
Then type: git commit -m "adding files". And then: git push -u origin master .
And then you should be all set. If you refresh your GitHub account, the files should be there :)
Follow these steps to upload your project to GitHub:
git init
git add .
git commit -m "Add all my files"
git remote add origin https://github.com/yourusername/your-repo-name.git
Upload of the project from scratch requires git pull origin master.
git pull origin master
git push origin master
If any problem occurs in pushing, use git push --force origin master.
Follow these two steps:
Create the repository online using the link: https://github.com/new
Then link your local repo to the remote repo using the command: git add remote origin https://github.com/userName/repo.git
Here the repo.git will be your newly created remote repo.
This will work like a charm. No need to worry about the SSH or HTTPS ways. I first faced the same issue and spent hours for solution.
But this worked for me.
Easy-to-follow steps: git pull origin master or main will give a fatal error:
Couldn't find remote ref main
So below steps will work just fine.
git init
git add .
git commit -m "initial commit"
git remote add origin https://github.com/yourusername/your-repo-name.git
git branch -M main
git push -u origin main
This worked for me;
1- git init
2- git add .
3- git commit -m "Add all my files"
4- git remote add origin https://github.com/USER_NAME/FOLDER_NAME
5- git pull origin master --allow-unrelated-histories
6- git push origin master
Create a new repository on GitHub. To avoid errors, do not initialize
the new repository with README, license, or gitignore files. You can
add these files after your project has been pushed to GitHub. Open
Terminal (for Mac users) or the command prompt (for Windows and Linux
users).
Change the current working directory to your local project.
Initialize the local directory as a Git repository.
git init
#Add the files in your new local repository. This stages them for the first commit.
git add
# Adds the files in the local repository and stages them for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'. Commit the files that you've staged in your local repository.
git commit -m 'First commit'
#Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.
At the top of your GitHub repository's Quick Setup page, click to copy the remote repository URL. At the top of your GitHub repository's Quick Setup
page, click to copy the remote repository URL.
In the Command prompt, add the URL for the remote repository where your local repository will be pushed.
$ git remote add origin remote repository URL
# Sets the new remote git remote -v
# Verifies the new remote URL Note: GitHub for Windows users should use the command git remote set-url origin instead of git remote add origin here. Push the changes in your local repository to GitHub.
$ git push origin master
# Pushes the changes in your local repository up to the remote repository you specified as the origin.
Source attribution: Adding an existing project to GitHub using the command line
I assume you are on a Windows system like me and have Git installed. You can either run these commands by simple command prompt in the project directory or you can also use Git Bash.
Step 1:
Create a repository in Git manually. Give it whatever name you seem fit.
Step 2:
Come to your local project directory. If you want to publish your code to this new repository you just created, make sure that in the projects root directory there is no folder name .git. If there is, delete it.
Run command git init.
Step 3:
Run command
git add .
Step 4:
Run command
git commit -m YourCommitName
Step 5:
Run command
git remote add YourRepositoryName https://github.com/YourUserName/YourRepositoryName.git
Step 6:
Run Command
git push --set-upstream YourRepositoryName master --force
Please note that I am using the latest version of Git at the time of writing. Also note that I did not specify any particular branch to push the code into so it went to master. In step 6 the Git will ask you to authorize the command by asking you to enter username and password in a popup window.
Open Git Bash.
Change the current working directory to your local project.
Initialize the local directory as a Git repository: $ git init
Add the files in your new local repository. This stages them for the first commit: $ git add .
Commit the files that you've staged in your local repository: $ git commit -m "First commit"
At the top of your GitHub repository's Quick Setup page, click to copy the remote repository URL.
In the Command prompt, add the URL for the remote repository where your local repository will be pushed : $ git remote add origin remote repository URL
Push the changes in your local repository to GitHub: $ git push origin master
First you have to create an account on GitHub
Then create a new project - name that project as you want and then your project URL is shown
Now copy the URL
Then open a Command Prompt and go to the directory or folder which you want to upload using cmd
Then type the following commands
git init
git add .
git commit -m "initial commit"
git remote add origin PASTE URL
git push -u origin master
Now check your GitHub account. The repository is successfully uploaded.
For complete guidance, you can watch this video.
It took me like 1-2 hours to realize that I'm supposed to create the repository at GitHub before trying to push my local files to GitHub (or whatever, Git service you're using).
After trying to push, errors were like:
remote: Repository not found.
fatal: repository 'https://github.com/username/project.git/' not found
I feel like an idiot, but I really would like to emphasize this for beginners like me. I just thought that my repository will be created automatically during the first push. I was so wrong.
You can see your remotes with this command:
git remote -v
Steps to upload project to Git:
Step 1 - open cmd and change the current working directory to your project location.
Step 2 - Initialize your project directory as a Git repository.
git init
Step 3 - Add files in your local repository.
add .
Step 4 - Commit the files that you've staged in your local repository.
git commit -m "First commit"
Step 5 - Copy the remote repository URL.
Step 6 - Add the remote repository URL as origin in your local location.
git add origin copied_remote_repository_url
Step 7 - Confirm your origin is updated or not.
git remote show origin
Step 8 - Push the changed to your GitHub repository
git push origin master.
I think the easiest thing for you to do would be to install the Git plugin for Eclipse. It works more or less the same as the Eclipse CVS and SVN plugins.
Make sure that Git is installed on your system. I'm explaining the process using windows OS [Although it shouldn't be OS dependent job]
Here is how I did:
Open the cmd (you can do with git bash as well if you've installed git bash).
Go to your project directory (where your project is located, it's essentially changing to directory either usiing cd path or through manual folder navigation).
Now type git init. This will initialize an empty repository if it is first time and Enter.
For example: git init
Now type git add <filename>(if specific file) or git add <filename1> <filename2> <filenameN> (if specific but more than one files) or git add . (if you want to add all files) and enter.
Now type git commit -m "commit message goes here" and enter.
(in case if you need to check the status you can do by typing git status) and enter.
Now type git remote add origin git_repository_url
(check git remote -v go check remote repository) and Enter.
Now it's turn to push it to the remote repository [essentially taking all the changes from local git to cloud(github) ...git push origin master and enter
(if you get error you push it forcefully by typing ...git push -f origin master and enter.
NOTE : master is the name of your master branch. If you've multiple branches, make sure that you select the name of the branch accordingly.
Now you're done with adding it to your remote repository from local computer. Refresh it and it will be there in your created repository's selected branch.
Probably the most useful thing you could do is to peruse the online book Pro Git. It's really a pretty decent read and gives you the conceptual context with which to execute things properly.
Follow the instructions from RishiKesh Pathak. You can even short the push command by inserting this command line one time only:
git config --global push.default simple
So next time instead of using git push origin master you just need:
git push
See details here.
Download Sourcetree.
It is available for Windows 7 (and later) and Mac, and it is highly recommended to upload files on GitHub via the interactive UI.
The best way to use Git is to actually start Gitting. Try out this website which makes you go step by step on what are the essential ways for performing functions on command line for pushing a project on GitHub.
This is called try.github.io or you could also take up a course on Codecademy.
I did as follows;
git init
git add .
git commit -m "Your_message"
git remote add origin #your_git_repository
git push -u origin master
Of course you have to install Git.
We need Git Bash
In the Git Bash Command Section:
ls
It will show your default location.
CD "C:\Users\user\Desktop\HTML"
We need to assign the project path.
git init
It will initialize the empty Git repository in C:\Users\user\Desktop\HTML
ls
It will list all file names.
git remote add origin https://github.com/repository/test.git
It is your https://github.com/repository/test.git is your repository path
git remote -v
To check whether we have fetch or push permission or not
git add .
If you use . then it means whatever we have in the particular folder publish all.
git commit -m "First time"
git push -u origin master
Upload a project from Visual Studio Code to GitHub
To upload your project in GitHub using Visual Studio Code, follow the following steps.
Open the Visual Studio Code. if you don't have the VSCode download: Download Visual Studio Code
In VSCode go to File-->Open Folder..
Go to Terminal-->New Terminal
Execute the following commands one by one after one another in order
git init
git add .
git commit -m "First Commit"
git remote add origin https://github.com/yourusername/your-repo-name.git
git push origin master
Note: in the above command git remote add origin https://github.com/yourusername/your-repo-name.git please change the bold sections with your GitHub account name and your repository name.
You need an SSH connection and GitHub init into your project. I will explain under Linux machine.
Let's start with some easy stuff: navigate into your project in the terminal, and use:
git init
git add .
git commit
Now let's add SSH into your machine:
use
ssh-keygen -t rsa -C "your_email#example.com"
Copy the public key, and then add it to your GitHub repository:
Deploy keys -> add one
Back to your machine project, now launch:
git push origin master
if there is an error, configure your .github/config file by
nano .github/config
And change the URL to the SSH one by:
url = git#github.com:username/repo....
And that's it.
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.
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.
A 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
You just need to know few command im cmd to push or pull any directory to/from github.
Command to push/upload any project or code to the git hub.
First reach to the working directory or project directory which you need to upload.
to check the correct working directory
ls
to initialize the git in the directory
git init
to the check that git init worked or not
ls -a //this command shows hidden files
Using above command you will find file added in you directory.
./ ../ .git/
the above is not a command you can skip it.
Now add the files of working directory to commit
git add .
then use commit command and name that commit for reference
git commit -m "Commit Name"
Before final step you need to go to the github website and create a new repository and copy the url of the repository
git remote add main https://github.com/username/repositoryName.git
now command to upload the directory
git push -u main
Note: the name "main" is the name that can be change as per user
For uploading a new project into Git (first you need to have the local code base of the project and the Git repository where you will be uploading project. In Git, you need to have your credentials).
List item
Open Git Bash
Go to the directory where you have the code base (project location)
cd to project location
cd ////**
Then here you need to execute Git commands.
git init
Press Enter then you will see something like this below.
The initialized empty Git repository in ://****/***/.git/, so git init will initialize the empty Git repository at local
git add .
Press Enter
The above command will add all the directories, subdirectories, files, etc.
You will see something like this:
warning: LF will be replaced by CRLF in **************.
The file will have its original line endings in your working directory.
git commit -m "first commit"
Press Enter. -m provided option for adding comment.
It will commit the code to the stage environment.
You will see some thing like this:
[master (root-commit) 34a28f6] adding ********
warning: LF will be replaced by CRLF in c*******.
The file will have its original line endings in your working directory.
27 files changed, 3724 insertions(+)
create mode 100644 *****
create mode 100644 *****
create mode 100644 *****
git remote add origin
http://username#git:repopath.git
Press Enter. This will add to the repository.
git push -u origin master
Press Enter.
This will upload all from local to repository in this step you need to enter password for the repository where you will be uploading the code.
You will see some thing like this below:
Counting objects: 33, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (32/32), done.
Writing objects: 100% (33/33), 20.10 KiB | 0 bytes/s, done.
Total 33 (delta 14), reused 0 (delta 0)
To http://username#git:repolocation.git \
[new branch] master -> master
Branch master set up to track remote branch master from origin.

Resources