Pull an exsisting file to Github #143452
Replies: 2 comments
-
To add an existing project to a GitHub repository, you can follow these steps. I'll walk you through both the Git command line process and some common troubleshooting tips in case there are issues along the way. 1. Initialize Git in Your Project DirectoryIf your project isn’t already a Git repository: cd /path/to/your/project
git init 2. Add Your FilesStage all files to prepare them for commit: git add . 3. Commit the ChangesCreate an initial commit with a message: git commit -m "Initial commit" 4. Add the GitHub Repository as a RemoteGo to GitHub, create a new repository, and do not initialize it with a README (since you already have an existing project). Copy the repository URL and add it as a remote: git remote add origin https://github.com/your-username/your-repo-name.git 5. Push to GitHubPush your local repository to GitHub: git push -u origin main (If your main branch is named Troubleshooting Tips
if your issue was fixed make this as a answer and if it is not we can find out more ways to that |
Beta Was this translation helpful? Give feedback.
-
Hi @priyadigyna 👋🏾, if any of the responses here answered your question can you please mark their response as the answer? When you mark a question as an answer, GitHub will highlight the comment and replies to the comment to help visitors quickly find the answer. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I am unable to add an exsisting project to github repository....
How can I resolve this issue?
Beta Was this translation helpful? Give feedback.
All reactions