GitHub
Development | GitHub | Ux Ui | DataBase | Symfony | JavaScript | AJAX | CLI |
Workstation | CentOS 7 | CentOS 8 | PHP 7.4 | Deploy | Work | Testing |
After creating a new GitHub, we now need to bring this to our Workstation to start developing.
GIT
Open your account on https://github.com/, and create a new Private Repository. Do Initialize this repository with the three files.
Click Create repository. Done!
On Your Worstation
Go into the repository, and click on Code.
On your workstation, go into your projects directory, do not create a subfolder for this project git will do that for us.
Let's start using the Command-Line of git.
git clone
Copy your https code in my case it is
git clone https://github.com/sitemaster-journey/kokua.git
You will not be able to use this as you do not know my username or password.
Cloning into 'kokua'... Username for 'https://github.com': xxxxxxx@xxxxx.xxxxx Password for 'https://xxxxxxx@xxxxx.xxxxx@github.com': remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/sitemaster-journey/kokua.git/'
This failed for me because I need to use my two-factor authentication token.
Let's try again with the token.
git clone https://github.com/sitemaster-journey/kokua.git Cloning into 'kokua'... Username for 'https://github.com': xxxxxxx@xxxxx.xxxxx Password for 'https://xxxxxxx@xxxxx.xxxxx@github.com': remote: Enumerating objects: 3, done. remote: Counting objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), done.
git add <file>
Go ahead and just create a file
touch INSTALL.md git add INSTALL.md
git status
git status # On branch main # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # new file: INSTALL.md # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # INSTALL.md~
I think I have this the right way round.
git commit
git commit -m "First Time Commit" [main e1e0bac] First Time Commit 1 file changed, 1 insertion(+) create mode 100644 INSTALL.md
git push
git push warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git) Username for 'https://github.com': sitemaster@kokua.family Password for 'https://sitemaster@kokua.family@github.com': Counting objects: 4, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 301 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To https://github.com/sitemaster-journey/kokua.git 97cdf94..e1e0bac main -> main
There are things that can be done to get rid of some of these messages.
git config
git config credential.helper store
- Create a new File.
- Add this new File.
- Commit this new File.
- Push, now when you get asked for your username and password, it will be remembered.
What Next
Now we move from Git to Symfony.