In this video, we are covering the following topics:
- Creating a repository.
- Setting up a repository.
- Cloning a repository.
- Various Git file status.
- Tagging.
- Undoing commits.
- Using the Git reset
and remove
commands.
- Collaborating with Git.
- Git Branching.
- Making a pull request.
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
Please login to comment
93 Comments
the webpage is opening like this.
but i am not getting the link of my name under about us
Hi jasmeen,
Here are a few things to check:
1. Check the HTML File:
Open your Flask template (e.g.,
about.html
) and ensure your name is linked correctly:or
2. Check Flask Routing:
If your page is dynamically generated, ensure you have a Flask route like this:
3. Ensure Static Files Load Properly:
If using static HTML files, make sure
jasmeen.html
is inside thetemplates
folder and properly linked.4.Inspect Page Source:
Right-click on the page and select "View Page Source" to check if your name's link appears in the HTML.
5.Clear Cache & Restart Flask Server:
- Clear your browser cache and reload.
- If using Flask, restart the development server with
flask run
.If you've tried these steps and still face issues, let me know what your code looks like, and I can help debug further!
Upvote Sharethere were some faults in syntax . now it works fine. thanks.
Upvote Share(webserver01) [jasmeenkaur0919997520@cxln4 Session3]$ git clone https://github.com/singh-ashok25/webserver.git
Cloning into 'webserver'...remote: Enumerating objects: 147, done.remote: Counting objects: 100% (143/143), done.remote: Compressing objects: 100% (71/71), done.remote: Total 147 (delta 76), reused 115 (delta 64), pack-reused 4 (from 1)
fatal: write error: Bad file descriptorfatal: index-pack failed
(webserver01) [jasmeenkaur0919997520@cxln4 Session3]$ cd /tmp
(webserver01) [jasmeenkaur0919997520@cxln4 tmp]$ git clone https://github.com/singh-ashok25/webserver.git
Cloning into 'webserver'.../tmp/webserver/.git: Permission denied
I tried cloning the repo in session3 but it failed. so i tried cloning it in /tmp but then again it says permission denied.
Hey Jasmeen, Make sure you follow all the steps as listed in: https://discuss.cloudxlab.com/t/bad-file-descriptor-while-running-git-clone/8351.
I see you have missed out on 'After that, create a directory with your username to avoid ownership issues, and clone the repo inside the newly created directory.'.
Upvote Sharedone. Thanks
Upvote Share[jasmeenkaur0919997520@cxln4 lab03]$ git remote add origin git@github.com:Jasmeen-1999/lab03.
gitfatal: remote origin already exists.
[jasmeenkaur0919997520@cxln4 lab03]$ git push -u origin main
Username for 'https://github.com': Jasmeen-1999
Password for 'https://Jasmeen-1999@github.com':
fatal: Authentication failed for 'https://github.com/Jasmeen-1999/lab03.git/'
[jasmeenkaur0919997520@cxln4 lab03]$
I used the SSH instead of https but still the authentication fails. what to do now?
Upvote ShareI was facing Authentication issue.. And it got resolve by Creating PAT on github.com and using it to commit and push.
1. Create PAT and noteit down somewhere as it is visioble once while it get created.
then use below commands.
* git remote set-url origin https://<YOUR_PAT>@github.com/<USERNAME>/<REPOSITORY>.git
after that it will work for commit and push.
Upvote ShareThanks. I created PAT in github.
but still it shows an error
[jasmeenkaur0919997520@cxln4 lab03]$ git push -u origin main
error: src refspec main does not match any.
error: failed to push some refs to 'https://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@github.com/Jasmeen1999/lab03.git
would you mind suggesting me where i could have gone wrong.
Upvote ShareHey Jasmeen,
The error you're encountering,
error: src refspec main does not match any
, usually happens when:1. The local branch doesn't exist: Your local branch might not be named
main
or might not have any commits yet.2. Repository was initialized but has no commits: If your repository is newly created and has no commits, you’ll see this error when trying to push.
Upvote Shareyes the repository is newly created. Thanks.
Upvote ShareHey Jasmeen,
If your repository is empty and you haven’t committed any changes, Git won’t have a branch to push. Make some changes first and then try committing.
Upvote Shareexecuted successfully. Thank you for your support.
Upvote ShareGetting this error
Upvote ShareHow to fix it?
Upvote ShareHi Sushant,
You can remove the port number from the url to access it. If you are running any app on our lab, then make sure you have mentioned the correct port number.
Upvote ShareHi Shubh i was trying to access this URL as part of the lab after changing the port number in "app.py" , I even tried with port no: 4080 but it stil gives the same error
Upvote ShareNo worries, I figured it out
Upvote ShareHi Prince,
What do you understand from the displayed error?
Upvote ShareThis comment has been removed.
I think i dont have authentication to mearge any mew change in this repo
Upvote ShareHi Prince,
I will advise you to go through this project first: https://cloudxlab.com/assessment/playlist-intro/435/getting-started-with-git?course_id=206&playlist_id=435. It will help clarify all the basics of Git and give you a better understanding. Once you've completed it, you can revisit this exercise and see if you can complete it with more confidence.
Complete sir but i did't figure out this error my username and password is also correct but same output again and again
Upvote ShareIt looks like you're trying to push your changes directly to the original repository, but you're encountering a
403
error, which means you don't have permission to push to that repository. Here's what you need to do:1. Fork the repository: Go to the repository (
https://github.com/singh-ashok25/webserver/
) on GitHub and click 'Fork' to create a copy under your account.2. Clone your fork: Clone your forked repository to your local machine using the following command:
3. Add your changes: Move your changes to this cloned repository (your forked version).
4. Push to your fork: After making the changes, push them to your forked repository's branch:
If you need help with any of these steps, feel free to ask!
1 Upvote ShareYou can switch to SSH for authentication, which avoids the need for a password or token. You can refer to https://cloudxlab.com/assessment/displayslide/4953/github-project-getting-started-with-git-creating-ssh-keys-and-adding-to-github?course_id=206&playlist_id=435 for it.
1 Upvote ShareThis comment has been removed.
Hi Sir, I didn't get any reply of my questions from any working professional of your team. where i go sir, how many comment required to get attention of you guys ? u don't told us before about this truth if i know i do every things from my own and self reading then i thoughts 1 time before taking admission .Sorry sir but all students are not from it background so they have so many doubt but no any answer and if some one reply they reply after 7 days or sometime a monts later . Its not fair sir at least you guys should reply every comment, if its not possible then please create ai for best and better understandability of students .. Thanks for your precious time if u reply me Sir
1 Upvote ShareHi Prince,
Thank you for sharing your thoughts and for your patience. I understand how frustrating it must be to have unanswered questions, especially when you're navigating a field that may be new to you. We genuinely appreciate your feedback, and I sincerely apologize for any delays in responses you've experienced.
At the moment, I cannot see any of your other comments apart from this slide. It seems that your query regarding hardlinks to a directory was already resolved via email, which is why it was not answered again in the comments section. Could you please share any other questions or concerns, or links to your previous comments, so we can assist you further?
Your learning experience is important to us, and we're here to support you throughout your journey.
Thank you again for your understanding and for bringing this to our attention!
Upvote ShareHi , I can't understant anythings in this 4 lab if anyone avlaible please help me . I am too confuse
and the tutior of this video make more confusable this topic please help....
1 Upvote ShareHi Prince,
Let's understand it step by step.
Here, the goal is to develop a feature in a public repository by adding functionality to a web server. Specifically, we are adding a personalized link to the homepage, which will lead to a custom HTML page named after you.
Steps Breakdown:
1. Create a feature branch and switch to the newly created branch
In Git, branches allow you to work on different parts of a project separately without affecting the main (or "production") version of the code. By creating a branch named
feature/<name>
, you’re setting up an isolated environment to implement and test new features. This branch can later be merged into the main project once everything works as expected.After creating the branch, you need to switch to it so you can start making changes in that branch. The below command creates a new branch and switches to it:
2. Make the required changes
Now that you’re in your feature branch, you can do your work—whether it’s editing
index.html
or making any other changes required for the task. In this case, you're adding a personalized link to the homepage and creating a custom HTML page.3. Commit the changes and merge them into the main branch
Once your changes are done and you’ve tested them, you need to commit them to your feature branch. Then, you can merge your feature branch into the main branch to make your changes live.
This process ensures that your new feature is successfully added to the main project, maintaining a clean and organized workflow.
Upvote Share* Debug mode: on
* Running on all addresses.
WARNING: This is a development server. Do not use it in a production deployment.
* Running on http://10.142.1.4:4180/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 673-864-876 ,
I Have chnaged port in app.py file nad running url am using http://f.cloudxlab.com:4180/
but showing This site can’t be reached
Please Guide.
Upvote ShareHi Priyanka,
Can you try http://e.cloudxlab.com:4180/? The 'f' cluster is currently not in use, so we recommend using the 'e' cluster instead.
If you face any further issues, feel free to reach out, and we’ll be happy to assist you!
Hi ,
I have checked with URl as you have suggested with 'e' cluster.
Tried all steps from begaining again and install flask everything but still having same issue This site can’t be reached URL not working.
Kindly Suggest.
Upvote ShareCan you share screenshot of the issue you are facing?
Upvote ShareThis comment has been removed.
Hi , I have attahed screenshot please check
Let’s debug it. We can start with some basic steps such as:
1. Check port in
app2.py
: Ensure the app is running on port4080
in theapp.run()
line.2. Verify server listening on port: Use
Upvote Sharenetstat -tuln | grep 4080
to confirm if the server is active on the specified port.Thank You. Issue Solved. The support received here is one of the standout features of this platform.
Upvote SharePlease help to resolve this issue - (venv) [pmokase185079@cxln4 webserver]$ python app.py
Upvote ShareTraceback (most recent call last):
File "app.py", line 1, in <module>
from flask import Flask, escape, request
ModuleNotFoundError: No module named 'flask'
Hi Priyanka,
Make sure you have installed flask in your virtual environment.
Upvote ShareHI Team,
I am getting an error while peforming Git Push. I ensured my ID and PWd is correct by signing out and signing into github. Kindly guide.
webserver01) [vidyakuruvalli8417@cxln4 webserver]$ 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': Vidya-kuruvalli
Upvote SharePassword for 'https://Vidya-kuruvalli@github.com':
fatal: Authentication failed for 'https://github.com/singh-ashok25/webserver/'
(webserver01) [vidyakuruvalli8417@cxln4 webserver]$
Hi VIdya,
Are you trying to push to ashok's repository https://github.com/singh-ashok25/webserver/ ?
Upvote Shareif yes, then this won't execute because you don't have access to the repository.
Hello, while installing flask getting an SSL verification failer error.
Upvote Share(webserver01) [vidyakuruvalli8417@cxln4 webserver]$ pip install Flask
Upvote ShareCollecting Flask
Could not fetch URL https://pypi.python.org/simple/flask/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852) - skipping
Could not find a version that satisfies the requirement Flask (from versions: )
No matching distribution found for Flask
To resolve the SSL certificate issue while installing Flask with
pip
, follow these steps:1. Upgrade
pip
:2. Install
certifi
:3. Set
REQUESTS_CA_BUNDLE
environment variable:This comment has been removed.
Got the below error when tried upgrading pip
(webserver01) [vidyakuruvalli8417@cxln4 webserver]$ python -m pip install --upgrade pip
Upvote ShareCould not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852) - skipping
Requirement already up-to-date: pip in /home/vidyakuruvalli8417/webserver01/lib/python3.6/site-packages
(webserver01) [vidyakuruvalli8417@cxln4 webserver]$ python -m pip install --upgrade pip
Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852) - skipping
Requirement already up-to-date: pip in /home/vidyakuruvalli8417/webserver01/lib/python3.6/site-packages
(webserver01) [vidyakuruvalli8417@cxln4 webserver]$ pip install certifi
Collecting certifi
Could not fetch URL https://pypi.python.org/simple/certifi/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852) - skipping
Could not find a version that satisfies the requirement certifi (from versions: )
No matching distribution found for certifi
(webserver01) [vidyakuruvalli8417@cxln4 webserver]$ export REQUESTS_CA_BUNDLE=$(python -m certifi)
/home/vidyakuruvalli8417/webserver01/bin/python: No module named certifi
(webserver01) [vidyakuruvalli8417@cxln4 webserver]$
It seems there is an issue with virtual environment. Can you please delete the environment, and re-create it. You can follow the steps mentioned at: https://cloudxlab.com/blog/install-python-packages-cloudxlab/ to create a virtual environment and installing python packages in it.
Upvote ShareHi, I did start from scratch and followed the steps but it is still the same issue
This comment has been removed.
https://cloudxlab.com/blog/install-python-packages-cloudxlab/ this way of creating Virtual environment helped
I am able to install flask
Upvote ShareI tried to deploy the app using flask. Getting the below error
Hi Kaustubh,
What I can understand from the error is that URL is incorrect. It will be like this: http://f.cloudxlab.com:4100/
Upvote ShareThanks. Problem Solved. This kind of support that you provide is the best feature of this course.
Upvote ShareThanks for the appreciation Kaustubh! :)
Upvote SharePlease help me with this following issue
Hi Vishwajeet,
You must set your identity, i.e., email and name, before committing so that git can track who has made the commit. You can use the commands that git suggested in above screenshot to set your email and name.
Upvote SharePlease help me with folloeing issue.
Hi Vishwajeet,
To resolve that, you can clone the repo in the tmp directory and then move it to your home directory. You can move to the tmp directory by using:
After that, clone the repo as told in the tutorial. After the repo gets cloned, move the webserver directory to your home directory by-
where, source is the path of the directory which you want to move, and destination is the path of the directory where you want to move the source directory.
That may do your work.
1 Upvote ShareThis comment has been removed.
This comment has been removed.
Thanks for your help!
It worked...
Upvote ShareHi I am facing the same issue. It is showing the following error message:
Upvote Sharemv: cannot move ‘/tmp’ to ‘/Session3’: Permission denied
Hi Kaustubh,
You cannot move the whole /tmp directory but only the files owned by you present inside the /tmp directory.
Upvote ShareI used the following command. I am still facing issues.
mv /tmp/webserver ~/Session3
Problem Solved. Thanks for the help.
Upvote ShareThis comment has been removed.
For Lab 4 in GITHUB Course
The "git push origin <feature-branch>" command prompts for credentials, Do we need to have Ashok's credentials or is there another way to proceed with this.
Hi RIshab,
You can't push to someone's else repository. You can only clone/fork it if it is public.
Upvote ShareHi Sachin,
Make sure you are entering the correct credentials when asked. I would suggest you to setup up ssh access from the command line and add it to GitHub. Then you will not need to enter username and password again and again.
You can refer to https://cloudxlab.com/assessment/displayslide/4953/github-project-getting-started-with-git-creating-ssh-keys-and-adding-to-github?course_id=116&playlist_id=435 for it.
Upvote ShareBut it doesn't ask for authentication when cloning public repositories. You are using an incorrect URL to clone the webserver directory. The correct command is:
You have replaced 'singh-ashok25' with 'singh.ashok25'.
Upvote ShareIn Lab02, after creating Repository it doesn't shows commands (as explained by tutor). Please suggest.
Upvote ShareHi Sachin,
In earlier versions of GitHub, the list of commands used to be displayed. To learn the essential commands, you can follow the video tutorial and replicate the actions of the instructor.
Upvote ShareI am unable to create a virtual environment using the virtualenv package on my local machine. For reference i am ran this command on a windows system (VS Code terminal)
Upvote ShareWhat error does it shows?
Upvote ShareThis comment has been removed.
Much helpful content!!
Upvote ShareThis comment has been removed.
Hi,
I am getting the below permission error, while installing Flask
[manojtechie8066@cxln4 ~]$ export PATH=/usr/local/anaconda/bin:$PATH
[manojtechie8066@cxln4 ~]$ cd Session3/
[manojtechie8066@cxln4 Session3]$ cd webserver/
[manojtechie8066@cxln4 webserver]$ pip install Flask
Collecting Flask
Downloading https://files.pythonhosted.org/packages/f2/28/2a03252dfb9ebf377f40fba6a7841b47083260bf8bd8e737b0c6952df83f/Flask-1.1.2-py2.py3-none-any.whl (94kB)
|????????????????????????????????| 102kB 1.2MB/s
Requirement already satisfied: Jinja2>=2.10.1 in /usr/local/anaconda/lib/python3.6/site-packages (from Flask) (2.10.1)
Requirement already satisfied: click>=5.1 in /usr/local/anaconda/lib/python3.6/site-packages (from Flask) (7.0)
Requirement already satisfied: Werkzeug>=0.15 in /usr/local/anaconda/lib/python3.6/site-packages (from Flask) (0.15.4)
Requirement already satisfied: itsdangerous>=0.24 in /usr/local/anaconda/lib/python3.6/site-packages (from Flask) (1.1.0)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/anaconda/lib/python3.6/site-packages (from Jinja2>=2.10.1->Flask) (1.1.1)
Installing collected packages: Flask
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/anaconda/lib/python3.6/site-packages/flask'
Consider using the `--user` option or check the permissions.
[manojtechie8066@cxln4 webserver]$ ls
app1.py app2.py app3.py app.py docker-compose.yml Dockerfile README.md requirements.txt static templates
Kindly suggest.
Upvote ShareHi,
Please use a virtual environment if you want to install any modules on the lab. For directions in virtual environment usage, please visit https://cloudxlab.com/blog/install-python-packages-cloudxlab/
Thanks.
1 Upvote Sharei am trying to push but it is giving the error
remote: Permission to singh-ashok25/webserver.git denied to ashishsharma0286.
Upvote Sharefatal: unable to access 'https://github.com/singh-ashok25/webserver/': The requested URL returned error: 403
Hi,
Could you please elaborate on what you were trying to do? Please tell what exactly you wanted to do. If possible, please attach the screenshot of the issue.
Thanks.
Upvote ShareAfter chaning port to 4080 getting werkzeug.routing.BuildError
werkzeug.routing.BuildError: Could not build url for endpoint 'about'. Did you mean 'main' instead?
Upvote ShareHi,
Hope this helps: https://stackoverflow.com/questions/30501522/werkzeug-routing-builderror-with-flask-python
Thanks.
Upvote ShareThis site can’t be reached
e.cloudxlab.com took too long to respond.
Trying to access http://e.cloudxlab.com:5080/ where I launched app1.py
Upvote ShareHi,
Are you still facing the same issue?
Thanks.
Upvote Share