Git - Set local folder to remote git repository

1. Create a new repository on your Git Server

2. Open Terminal and change the current working directory to your local project.

3. Initialize the local directory as a Git repository.

    $ git init

4. Add the files in your new local repository. This stages them for the first commit.
    $ git add .

5. Commit the files that you've staged in your local repository.
    $ git commit -m "First commit"

6. add the URL for the remote repository where your local repository will be pushed.
    git remote add origin http://localhost:3000/IRPC/fiori-iSmart.git

7. Push the changes in your local repository to GitHub if there is a remote branch called master (or main if that's what you're using)
    git push origin master


below is example command that generate from Gitea.
touch README.md
git init

git add README.md
git commit -m "first commit"
git remote add origin http://localhost:3000/IRPC/fiori-iSmart.git
git push -u origin master

** Maybe you'll found error: “fatal: refusing to merge unrelated histories”. Try the command below to fixed the error.
    git pull origin master --allow-unrelated-histories


Popular posts from this blog

SAP CPI - Loop Process Call with SuccessFactor (oData V2)

Setting IntelliJ IDEA to run Groovy Script

C# - BASE64 to Image