Featured
- Get link
- X
- Other Apps
Git Basic and Push your First Poject to GitHub
1. Make sure you have Git Bash installed on your computer and run this command:
git --version
git version 2.7.0.windows.2
Now let Git know who you are. This is important for version control systems, as each Git commit uses this information
git config --global user.name "john"
git config --global user.email "john@mail.com"
Change the user name and e-mail address to your own. You will probably also want to use this when registering to GitHub later on.
2. Make sure git is tracking your project locally, using your terminal/command line, get inside the folder where your project files are kept:
cd D:\document\src\myproject
3. Check if git is already initialized:
git status
If you get this error message: fatal: Not a git repository (or any of the parent directories): .git, that means the folder you are currently in is not being tracked by git. In that case, initialize git inside your project folder and make your first commit:
git init
git add .
git commit -m "First release of my Project"
4. Create a remote, empty folder/repository on Github by login to your Github account. Then At the top right of any Github page, you should see a '+' icon. Click that, then select 'New Repository'.
5. Give your repository a name ideally the same name as your local project. If I'm building a travel application, its folder will be called 'travel-app' on my computer, and 'travel-app' will be the Github repository name as well.
6. Click 'Create Repository'. The next screen you see will be important, so don't close it.
7. The screen you should be seeing now on Github is titled 'Quick setup — if you’ve done this kind of thing before'. Copy the link in the input right beneath the title, it should look something like this:
https://github.com/yourname/yourproject.git
This is the web address that your local folder will use to push its contents to the remote folder on Github.
8. Go back to your project in the terminal/command line. In your terminal/command line, type:
git remote add origin https://github.com/yourname/yourproject.git
9. Push your branch to Github:
git branch -M master
git push -u origin master
10. Do your authentification on GitHub via web browser, then go back to the folder/repository screen on Github that you just left, and refresh it. The title 'Quick setup — if you’ve done this kind of thing before' should disappear, and you should see your files there.
11. Done!
- Get link
- X
- Other Apps
Popular Posts
Building a gRPC Service with Nested Messages, Repeated Fields, and Oneof in Python
- Get link
- X
- Other Apps
How the Diffie-Hellman Exchange Works: An Example in Python
- Get link
- X
- Other Apps
Comments
Post a Comment